You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change also makes bot edits fully concurrent with both the working
tree and index. All changes are applied to an independent tree,
committed separately from the current HEAD.
Controls behavior when staged changes are present at the start of a generate command.
79
-
If enabled, these changes are automatically reset and combined with other working directory changes.
80
-
Otherwise an error is raised.
81
-
82
69
--root::
83
70
Repository search root.
84
71
85
-
-D::
86
-
--show-drafts::
87
-
List recently created drafts.
88
-
89
-
-P::
90
-
--show-prompts::
91
-
Lists recently used prompts.
92
-
93
72
-T::
94
73
--show-templates::
95
74
Lists available templates.
@@ -109,20 +88,75 @@ The workhorse command is `git draft --generate` which leverages AI to edit our c
109
88
A prompt can be specified as standard input, for example `echo "Add a test for compute_offset in chart.py" | git draft --generate`.
110
89
If no prompt is specified and stdin is a TTY, `$EDITOR` will be opened to enter the prompt.
111
90
112
-
If not on a draft branch, a new draft branch called `drafts/$parent/$hash` will be created (`$hash` is a random suffix used to guarantee uniqueness of branch names) and checked out.
113
-
By default any unstaged changes are then automatically added and committed (`draft! sync`).
114
-
This behavior can be disabled by passing in `--stash`, which will instead add them to the stash.
115
-
Staged changes are always committed.
116
-
117
-
The prompt automatically gets augmented with information about the files in the repository, and give the AI access to tools for reading and writing files.
118
-
Once the response has been received and changes applied, a commit is created (`draft! prompt: a short summary of the change`).
91
+
By default, the prompt gets augmented with information about the files in the repository, and give the AI access to tools for reading and writing files.
92
+
Once the response has been received and changes applied, a commit is created in a separate branch.
119
93
120
94
The `--generate` step can be repeated as many times as needed.
121
95
Once you are satisfied with the changes, run `git draft --finalize` to apply them.
122
96
This will check out the branch used when creating the draft, adding the final state of the draft to the worktree.
123
97
Note that you can come back to an existing draft anytime (by checking its branch out), but you will not be able to apply it if its origin branch has moved since the draft was created.
124
98
125
99
100
+
* Generate: create a new draft to the current folio, or create a new folio if none exists.
101
+
* Finalize
102
+
** Apply: include changes into origin branch.
103
+
** Discard: abandon folio.
104
+
** Save: return to original branch. Q: how to load after?
105
+
* List templates
106
+
107
+
108
+
o Foo (main)
109
+
o Sync (drafts/123/pub)
110
+
111
+
# After generate without accept
112
+
o Foo (main)
113
+
o Sync (drafts/123)
114
+
o draft! <prompt> (drafts/123+, refs/drafts/123/1)
115
+
116
+
# After generate with accept
117
+
o Foo (main)
118
+
o Sync
119
+
|\
120
+
| o draft! prompt: <prompt> (refs/drafts/123/1)
121
+
o | Sync
122
+
|/
123
+
o Merge (drafts/123/pub)
124
+
125
+
126
+
o Foo (main)
127
+
o draft! sync
128
+
|\
129
+
| o draft! prompt: <prompt> (drafts/123+, refs/drafts/123/1)
130
+
o Something
131
+
o Also something (drafts/123)
132
+
133
+
134
+
o Foo (main)
135
+
o draft! sync
136
+
|\
137
+
| o draft! prompt: <prompt> (refs/drafts/123/1)
138
+
o Something
139
+
o Also something (drafts/123/pub)
140
+
o draft! prompt: <prompt> (drafts/123+, refs/drafts/123/2)
141
+
142
+
143
+
o Foo (main)
144
+
o draft! sync (drafts/123/pub)
145
+
|\
146
+
| o draft! prompt: <prompt> (refs/drafts/123/1)
147
+
\
148
+
o draft! prompt: <prompt> (drafts/123+, refs/drafts/123/2)
149
+
150
+
o Foo (main)
151
+
o draft! sync (drafts/123/pub)
152
+
|\
153
+
| o draft! prompt: <prompt> (refs/drafts/123/1)
154
+
|/
155
+
o draft! sync
156
+
\
157
+
o draft! prompt: <prompt> (drafts/123+, refs/drafts/123/2)
0 commit comments