]> git.99rst.org Git - git.git/commit
sequencer: do not record dropped commits as rewritten
authorPhillip Wood <redacted>
Wed, 15 Jul 2026 15:22:03 +0000 (16:22 +0100)
committerJunio C Hamano <redacted>
Wed, 15 Jul 2026 19:16:21 +0000 (12:16 -0700)
commit42554b78fd2c3ce252647c9c5afbf04d2f2885f5
treea1ae80f49fc0c2a40ed25dbed6c09f14f5f3afd4
parenta7dbb3a462eab29d5ca79c9cba175e0baeff6751
sequencer: do not record dropped commits as rewritten

If a commit gets dropped because its changes are already upstream
then we should not record it as rewritten. As well as confusing any
post-rewrite hooks, it means we end up copying the notes from the
dropped commit to the commit that was picked immediately before the
one that was dropped.

While we do not want to record the dropped commit as rewritten, if
it is the final commit in a chain of fixups then we need to flush
the list of rewritten commits. The behavior of an "edit" command
where the commit is dropped is changed so that "rebase --continue"
will not amend the previous pick. However, as the code comment notes
it will still be erroneously recorded as rewritten when the rebase
continues. That will need to be addressed separately along with not
recording skipped commits as rewritten.

The initialization of "drop_commit" is moved to ensure it is initialized
when rewording a fast-forwarded commit.

Reported-by: Uwe Kleine-König <redacted>
Tested-by: Uwe Kleine-König <redacted>
Signed-off-by: Phillip Wood <redacted>
Signed-off-by: Junio C Hamano <redacted>
sequencer.c
t/t3400-rebase.sh
t/t5407-post-rewrite-hook.sh
git clone https://git.99rst.org/PROJECT