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

Re: [PATCH v2] replay: support replaying down from root commit

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2026, 16:49 UTC
Message-ID
<xmqq7bqzx3au.fsf@gitster.g>
In-Reply-To
<CAP8UFD1zJXnsm7POK32GqEu4xSC+VO5mfzUpM-jn+Nr1qvzEFQ@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 6 quoted lines
> For example, before this, `git replay --onto main topic` would fail,
> but emit "fatal: replaying down from root commit is not supported
> yet!". This would likely help users understand that they might need to
> properly specify a range like "main..topic" instead of 'topic".
>
> Now it would likely fail without any error message.

The fact that I do not quite understand the suggested change is a very strong sign that people would be helped by a bit more documentation ;-).

Depending on what is in "topic" and what "main" has, wouldn't it be possible that the history leads to "topic" replay cleanly on top of "main"? And if there are problems (e.g., the replayed history may want to add a file where "main"'s history already has contents with a different ancestry sitting there, or the path may be taken by a directory), wouldn't "git replay" fail loudly explaining what got conflicted, instead of failing silently?

Show 12 quoted lines
> Maybe something like the following could help:
>
> --- a/Documentation/git-replay.adoc
> +++ b/Documentation/git-replay.adoc
> @@ -23,6 +23,10 @@ instead get update commands that can be piped to
> `git update-ref --stdin`
>
>  THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
>
> +Note that `git replay --onto main topic` replays the topic branch starting
> +from the root commit, not from main. What you might want instead is
> +`git replay --onto main main..topic`.

To be helpful, "might want" needs to be accompanied by "if you want to do X", I think. In this case, that X probably is "recreate what was done on 'topic' since it forked from 'main' on top of 'main'".

Thanks.
Previous: Christian Couder
Message 17 of 17 in “replay: support replaying down from root commit”
  1. replay: support replaying down from root commitToon Claes, Mar 17, 2026
  2. Junio C HamanoMar 17, 2026
  3. Toon ClaesMar 24, 2026
  4. replay: support replaying down from root commitToon Claes, Mar 24, 2026
  5. Junio C HamanoMar 24, 2026
  6. Christian CouderMar 25, 2026
  7. Ben KnobleMar 25, 2026
  8. Toon ClaesMar 25, 2026
  9. Toon ClaesMar 25, 2026
  10. Toon ClaesMar 25, 2026
  11. Junio C HamanoMar 27, 2026
  12. Christian CouderMar 31, 2026
  13. Junio C HamanoMar 31, 2026
  14. Toon ClaesApr 2, 2026
  15. Junio C HamanoApr 2, 2026
  16. Christian CouderApr 3, 2026
  17. Junio C HamanoMar 25, 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.