git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC 0/5] replay: support replaying 2-parent merges

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
May 7, 2026, 14:14 UTC
Message-ID
<CALnO6CDJgUEiEgG=4r_F4jeyrHSsSpwD0X8rZzh+EScL+vJn7g@mail.gmail.com>
In-Reply-To
<pull.2106.git.1778107405.gitgitgadget@gmail.com>
Hi Dscho,

On Wed, May 6, 2026 at 6:44 PM Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 37 quoted lines
>
> git history, the new history-rewriting builtin in v2.54, dies on any merge
> in the rewrite path with replaying merge commits is not supported yet!. That
> makes it not very useful for the workflows I actually have, where almost
> every interesting branch contains at least one merge of a feature topic. The
> natural fallback, git rebase --rebase-merges, is interactive and stops to
> ask for re-resolution even when no re-resolution is needed.
>
> This series lifts that limitation for the common 2-parent case. The
> algorithm itself is not new: Elijah Newren wrote it down in his replay
> design notes
> [https://github.com/newren/git/blob/replay/replay-design-notes.txt] and
> prototyped it in a 2022 work-in-progress sketch
> [https://github.com/newren/git/commit/4c45e8955ef9bf7d01fd15d9106b3bdb8ea91b45].
> What is new is wiring it into the replay_revisions() API that backs both git
> replay and git history, plus three specific tweaks that make the trickier
> cases work where the WIP sketch bailed out: identical conflict-marker labels
> for the inner remerges of the original and the rewritten parents (so their
> conflict-markered trees compare equal in the regions the user did not
> touch), tolerating result.clean == 0 from those inner merges (their
> well-defined conflict-markered trees are valid inputs to the outer 3-way
> merge), and self-fallback for both merge parents combined with mapping the
> rev-range boundary commits to the onto commit.
>
> Octopus merges and revert-of-merge are surfaced as explicit errors at the
> dispatch point. The split sub-command of git history continues to refuse
> when its target is a merge: split semantics simply do not apply there. The
> xdiff special mode for matching conflict-marker hunks across inner remerges,
> the XDL_MERGE_FAVOR_BASE variant, and the modify/delete and binary-file
> specials that the design notes flag as future work all remain future work.
>
> While I was at it, git history reword had a pre-existing silent-success bug:
> a positive return from replay_revisions() (which means "conflict, no updates
> queued") was treated as success. Obviously this should never occur, as a
> reword simply does not change any of the file contents, but bugs do happen.
> The merge-replay work is complex enough to make that class of bugs more
> likely, therefore I introduce error messages for those instances.

Fixing this bug sounded interesting; I had a hard time spotting it while skimming the first 2 patches.

Did I just miss it? Is it worth splitting that fix out to a separate patch?
Best,
-- 
D. Ben Knoble
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 16 of 19 in “replay: support replaying 2-parent merges”
  1. 0/5 replay: support replaying 2-parent mergesJohannes Schindelin via GitGitGadget, May 6, 2026
  2. 1/5 replay: support replaying 2-parent mergesJohannes Schindelin via GitGitGadget, May 6, 2026
  3. Phillip WoodMay 8, 2026
  4. Phillip WoodMay 8, 2026
  5. Johannes SchindelinMay 17, 2026
  6. Johannes SchindelinMay 17, 2026
  7. Kristoffer HaugsbakkMay 26, 2026
  8. Philippe BlainNov 5, 2026
  9. Philippe BlainNov 13, 2026
  10. 2/5 replay: short-circuit merge replay when parent and base trees are unchangedJohannes Schindelin via GitGitGadget, May 6, 2026
  11. 3/5 history.adoc: describe merge-replay support and its limitsJohannes Schindelin via GitGitGadget, May 6, 2026
  12. 5/5 t3454: cover merge-replay scenarios with the historian helperJohannes Schindelin via GitGitGadget, May 6, 2026
  13. 4/5 test-tool: add a "historian" subcommand for building merge fixturesJohannes Schindelin via GitGitGadget, May 6, 2026
  14. Toon ClaesMay 12, 2026
  15. Johannes SchindelinMay 17, 2026
  16. D. Ben KnobleMay 7, 2026
  17. Johannes SchindelinMay 7, 2026
  18. Ben KnobleMay 7, 2026
  19. Johannes SchindelinMay 17, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.