<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/sequencer.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-03T20:01:09Z</updated>
<entry>
<title>Merge branch 'sa/replay-revert'</title>
<updated>2026-04-03T20:01:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-03T20:01:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0613d24f9902a581b6a1cf0aa39b517db1e3f2f'/>
<id>urn:sha1:e0613d24f9902a581b6a1cf0aa39b517db1e3f2f</id>
<content type='text'>
"git replay" (experimental) learns, in addition to "pick" and
"replay", a new operating mode "revert".

* sa/replay-revert:
  replay: add --revert mode to reverse commit changes
  sequencer: extract revert message formatting into shared function
</content>
</entry>
<entry>
<title>sequencer: extract revert message formatting into shared function</title>
<updated>2026-03-25T21:20:57Z</updated>
<author>
<name>Siddharth Asthana</name>
<email>siddharthasthana31@gmail.com</email>
</author>
<published>2026-03-25T20:23:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e6434ebbd63d4ec0ad2f8bccf25bd0d98d55030'/>
<id>urn:sha1:1e6434ebbd63d4ec0ad2f8bccf25bd0d98d55030</id>
<content type='text'>
The logic for formatting revert commit messages (handling "Revert" and
"Reapply" cases, appending "This reverts commit &lt;ref&gt;.", and handling
merge-parent references) currently lives inline in do_pick_commit().
The upcoming replay --revert mode needs to reuse this logic.

Extract all of this into a new sequencer_format_revert_message()
function. The function takes a repository, the subject line, commit,
parent, a use_commit_reference flag, and the output strbuf. It handles
both regular reverts ("Revert "&lt;subject&gt;"") and revert-of-revert cases
("Reapply "&lt;subject&gt;""), and uses refer_to_commit() internally to
format the commit reference.

Update refer_to_commit() to take a struct repository parameter instead
of relying on the_repository, and a bool instead of reading from
replay_opts directly. This makes it usable from the new shared function
without pulling in sequencer-specific state.

Signed-off-by: Siddharth Asthana &lt;siddharthasthana31@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rebase: support --trailer</title>
<updated>2026-03-06T21:02:20Z</updated>
<author>
<name>Li Chen</name>
<email>me@linux.beauty</email>
</author>
<published>2026-03-06T14:53:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4f9d6b0ab2e1903765258991a6265599d0007ce'/>
<id>urn:sha1:e4f9d6b0ab2e1903765258991a6265599d0007ce</id>
<content type='text'>
Add a new --trailer=&lt;trailer&gt; option to git rebase to append trailer
lines to each rewritten commit message (merge backend only).

Because the apply backend does not provide a commit-message filter,
reject --trailer when --apply is in effect and require the merge backend
instead.

This option implies --force-rebase so that fast-forwarded commits are
also rewritten. Validate trailer arguments early to avoid starting an
interactive rebase with invalid input.

Add integration tests covering error paths and trailer insertion across
non-interactive and interactive rebases.

Signed-off-by: Li Chen &lt;me@linux.beauty&gt;
Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: pass strvecs around for setup_revisions_from_strvec()</title>
<updated>2025-09-22T21:27:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2025-09-19T22:50:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18068139f2d0fc2aa82f34f2c177d781e228e732'/>
<id>urn:sha1:18068139f2d0fc2aa82f34f2c177d781e228e732</id>
<content type='text'>
The previous commit converted callers of setup_revisions() with a strvec
to use the safer and easier _from_strvec() variant.

Let's now convert spots that don't directly have a strvec, but receive
an argc/argv pair that eventually comes from one. We'll instead pass the
strvec down to the point where we call setup_revisions().

That makes these functions slightly less flexible if they were to grow
other callers that don't use strvecs, but this rigidity is buying us
some safety. It is only safe to pass the free_removed_argv_elements
option to setup_revisions() if we know the elements of argv/argc are
allocated on the heap. That isn't communicated in the type system when
we are passed the bare elements. But if we get a strvec, we know that
the elements are allocated strings.

And at any rate, each of these modified functions has only a single
caller (that has a strvec), so the loss of flexibility is unlikely to
ever matter.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/rebase-i-error-message'</title>
<updated>2024-06-20T22:45:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-20T22:45:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83ac567781b53f7101c2a9b44462df447bbdc2c6'/>
<id>urn:sha1:83ac567781b53f7101c2a9b44462df447bbdc2c6</id>
<content type='text'>
When the user adds to "git rebase -i" instruction to "pick" a merge
commit, the error experience is not pleasant.  Such an error is now
caught earlier in the process that parses the todo list.

* pw/rebase-i-error-message:
  rebase -i: improve error message when picking merge
  rebase -i: pass struct replay_opts to parse_insn_line()
</content>
</entry>
<entry>
<title>rebase -i: pass struct replay_opts to parse_insn_line()</title>
<updated>2024-05-30T17:02:56Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2024-05-30T13:43:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c26738aa4a8256b40a46476c2433c03a562124f'/>
<id>urn:sha1:0c26738aa4a8256b40a46476c2433c03a562124f</id>
<content type='text'>
This new parameter will be used in the next commit. As adding the
parameter requires quite a few changes to plumb it through the call
chain these are separated into their own commit to avoid cluttering up
the next commit with incidental changes.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pw/rebase-m-signoff-fix'</title>
<updated>2024-04-30T21:49:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-30T21:49:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9f43012a10c4c4b26b8966fcf8497d8db0a0c06'/>
<id>urn:sha1:c9f43012a10c4c4b26b8966fcf8497d8db0a0c06</id>
<content type='text'>
"git rebase --signoff" used to forget that it needs to add a
sign-off to the resulting commit when told to continue after a
conflict stops its operation.

* pw/rebase-m-signoff-fix:
  rebase -m: fix --signoff with conflicts
  sequencer: store commit message in private context
  sequencer: move current fixups to private context
  sequencer: start removing private fields from public API
  sequencer: always free "struct replay_opts"
</content>
</entry>
<entry>
<title>sequencer: move current fixups to private context</title>
<updated>2024-04-18T20:33:41Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2024-04-18T13:14:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=497a01a2d3d2bef45dd76d76c769a0a2a3c80b57'/>
<id>urn:sha1:497a01a2d3d2bef45dd76d76c769a0a2a3c80b57</id>
<content type='text'>
The list of current fixups is an implementation detail of the sequencer
and so it should not be stored in the public options struct.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sequencer: start removing private fields from public API</title>
<updated>2024-04-18T20:33:41Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2024-04-18T13:14:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3152edc97ff37f61387c6b222c68bc4f8b19bee'/>
<id>urn:sha1:a3152edc97ff37f61387c6b222c68bc4f8b19bee</id>
<content type='text'>
"struct replay_opts" has a number of fields that are for internal
use. While they are marked as private having them in a public struct is
a distraction for callers and means that every time the internal details
are changed we have to recompile all the files that include sequencer.h
even though the public API is unchanged. This commit starts the process
of removing the private fields by adding an opaque pointer to a "struct
replay_ctx" to "struct replay_opts" and moving the "reflog_message"
member to the new private struct.

The sequencer currently updates the state files on disc each time it
processes a command in the todo list. This is an artifact of the
scripted implementation and makes the code hard to reason about as it is
not possible to get a complete view of the state in memory. In the
future we will add new members to "struct replay_ctx" to remedy this and
avoid writing state to disc unless the sequencer stops for user
interaction.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rebase -i: stop setting GIT_CHERRY_PICK_HELP</title>
<updated>2024-02-27T18:33:36Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2024-02-27T14:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=72a8d3f027a5ea04ac453583105b368cd88648cd'/>
<id>urn:sha1:72a8d3f027a5ea04ac453583105b368cd88648cd</id>
<content type='text'>
Setting this environment variable causes the sequencer to display a
custom message when it stops for the user to resolve conflicts and
remove CHERRY_PICK_HEAD. Setting it in "git rebase" is a vestige of
the scripted implementation, now that it is a builtin command we do
not need to communicate with the sequencer machinery via environment
variables.

Move the conflicts advice to use when rebasing into
sequencer.c so we do not need to pass it via the environment.

Note that we retain the changes in e4301f73fff (sequencer: unset
GIT_CHERRY_PICK_HELP for 'exec' commands, 2024-02-02) just in case
GIT_CHERRY_PICK_HELP is set in the environment when "git rebase" is
run.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
