Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `git-draft(1)` [![CI](https://github.com/mtth/git-draft/actions/workflows/ci.yaml/badge.svg)](https://github.com/mtth/git-draft/actions/workflows/ci.yaml) [![codecov](https://codecov.io/gh/mtth/git-draft/graph/badge.svg?token=3OTKAI0FP6)](https://codecov.io/gh/mtth/git-draft) [![Pypi badge](https://badge.fury.io/py/git-draft.svg)](https://pypi.python.org/pypi/git-draft/)

> [!NOTE]
> WIP: Unstable API.
> WIP: Evolving API.


## Highlights
Expand Down
40 changes: 20 additions & 20 deletions docs/git-draft.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ifndef::manversion[:manversion: 0.0.0]

= git-draft(1)
Matthieu Monsch
Matthieu Monsch <[email protected]>
v{manversion}
:doctype: manpage
:manmanual: GIT-DRAFT
Expand Down Expand Up @@ -110,58 +110,58 @@ When the working directory is clean, a single commit is created and set as the d

[source]
----
o <some commit> (main, draft/123)
o draft! prompt: <prompt> (draft/123+, refs/drafts/123/1)
o <some commit> (main, draft/123)
----

If the working directory is dirty, a sync commit is added to identify the LLM-generated changes.

[source]
----
o <some commit> (main, draft/123)
o draft! sync(prompt)
o draft! prompt: <prompt> (draft/123+, refs/drafts/123/1)
o draft! sync(prompt)
o <some commit> (main, draft/123)
----

If merging is enabled, it have both the LLM-generated changes and manual edits as parents.

[source]
----
o <some commit> (main)
o Merge (draft/123, draft/123/+)
|\
| o draft! sync(prompt)
o | draft! sync(merge)
| o draft! prompt: <prompt> (refs/drafts/123/1)
o | draft! sync(merge)
| o draft! sync(prompt)
|/
o Merge (draft/123, draft/123/+)
o <some commit> (main)
----

Otherwise, the user is free to incorporate the changes as needed.
Note that the steps above can be repeated arbitrarily many times within a given draft branch, both with and without automatic merging.

[source]
----
o <some commit> (main)
|\
| o draft! prompt: <prompt1> (refs/drafts/123/1)
o draft! sync(prompt)
o draft! prompt: <prompt2> (refs/drafts/123/2)
o <a manual commit> (draft/123)
o draft! prompt: <prompt3> (draft/123+, refs/drafts/123/3)
o <a manual commit> (draft/123)
o draft! prompt: <prompt2> (refs/drafts/123/2)
o draft! sync(prompt)
| o draft! prompt: <prompt1> (refs/drafts/123/1)
|/
o <some commit> (main)
----

Sync commits will be reused if no new changes were added.
This can be useful when iterating on a prompt, and discarding results from prior iterations.

[source]
----
o <some commit> (main)
o draft! sync(prompt)
|\
| \
|\ o draft! prompt: <prompt1> (refs/drafts/123/1)
| o draft! prompt: <prompt2> (refs/drafts/123/2)
o draft! prompt: <prompt3> (refs/drafts/123/3)
| o draft! prompt: <prompt2> (refs/drafts/123/2)
|/ o draft! prompt: <prompt1> (refs/drafts/123/1)
| /
|/
o draft! sync(prompt)
o <some commit> (main)
----


Expand Down