[PATCH 00/11] sequencer: do not record dropped commits as rewritten
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 30, 2026, 15:28 UTC
- Message-ID
- <cover.1782833268.git.phillip.wood@dunelm.org.uk>
- In-Reply-To
- <67dbfb5c-5f07-49b8-aa32-a4635c585028@gmail.com>
On 19/06/2026 11:13, Phillip Wood wrote:
> I'm happy to take this forward and try and fix at least some of the > other bugs I've listed above. Uwe - if I don't cc you on some patches > within the next couple of weeks please feel free to send a reminder.
Here is the first batch that fixes the same problem as Uwe's patch. I've taken a slightly different approach that uses the return value from do_pick_commit() to signal that a commit was dropped rather than adding another function argument. That involves a number of preparatory patches, but they are hopefully reasonably small and easy to follow.
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 this means we end up copying the notes from the dropped commit to the commit that was picked immediately before the one that was dropped.
This series is structured as follows:
Patch 1 restores some test coverage that was lost when the default rebase backend was changed.
Patch 2 moves a function so it can be called without a forward declaration in Patch 11.
Patches 3 & 4 fix the return value of do_pick_commit() when an external command fails (this is in preparation for patch 10).
Patches 5-9 try and simplify the control flow in pick_one_commit() in preparation for patch 10.
Patch 10 changes the return type of do_pick_commit() to an enum.
Patch 11 adds a new member to the enum from patch 10 for commits that are dropped when they become empty and uses that to stop them from being recorded as rewritten.
Base-Commit: 6c3d7b73556db708feb3b16232fab1efc4353428 Published-As: https://github.com/phillipwood/git/releases/tag/pw%2Frebase-drop-notes-with-commit%2Fv1 View-Changes-At: https://github.com/phillipwood/git/compare/6c3d7b735...26551f268 Fetch-It-Via: git fetch https://github.com/phillipwood/git pw/rebase-drop-notes-with-commit/v1
Phillip Wood (11): t3400: restore coverage for note copying with apply backend sequencer: move definition of is_final_fixup() sequencer: be more careful with external merge sequencer: never reschedule on failed commit sequencer: remove unnecessary "or" in pick_one_commit() sequencer: simplify handing of fixup with conflicts sequencer: remove unnecessary condition in pick_one_commit() sequencer: simplify pick_one_commit() sequencer: return early from pick_one_commit() on success sequencer: use an enum to represent result of picking a commit sequencer: do not record dropped commits as rewritten
sequencer.c | 154 +++++++++++++++++++++++----------- t/t3400-rebase.sh | 16 +++- t/t3404-rebase-interactive.sh | 11 +++ t/t5407-post-rewrite-hook.sh | 23 +++++ 4 files changed, 155 insertions(+), 49 deletions(-)
-- 2.54.0.200.gfd8d68259e3