Re: [PATCH v2] replay: support replaying down from root commit
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Mar 31, 2026, 10:34 UTC
- Message-ID
- <CAP8UFD3P2Gs0J1FNyKW2URwSEW4ZaTrVO7cM1V8sG+zzXctbhg@mail.gmail.com>
- In-Reply-To
- <xmqqfr5lkyq8.fsf@gitster.g>
On Fri, Mar 27, 2026 at 5:45 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 37 quoted lines
> > Toon Claes <toon@iotcl.com> writes: > > >> 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`. > >> + > > > > Definitely would help, not sure it needs to be part of this series. > > Where else should the patch to add such a note to the documentation > go, though? Without this patch, we do not is because the command > will not take such a command line. With this patch that adds the > "now we allow replay to take a single tip commit and replay the > history leading to the tip all the way down to root" feature, the > note may become relevant. > > So to me, it looks like it is either we will never add such a note > because it is irrelevant and everybody should know the consequence > of passing "topic", not "main..topic", or we will have to add such a > note as part of the series (if the note would help the readers). > > Even though I am on the fence about the need for this specific note > in the documentation, it does not make sense to me to say "this will > help but we are not doing so here". > > My comment on "might" in "What you might" in the thread still > applies, by the way.
Another approach with this is to consider that in the first place the main issue is that `git replay` doesn't emit any error message when it fails due to a conflict, which isn't user friendly.
So if we are about to fix that main issue in a separate patch or series, and if we plan to emit something like the following in the regular case:
"fatal: replaying failed due to conflict"
and something like the following when replaying from a root commit:
"fatal: replaying from root commit XXX failed due to conflict"
then I think it would alleviate the need for a doc update.
But anyway even if we are planning such an error message fix, I think a doc update would be nice, either along with such an error message fix or along with this patch which allows replaying from a root commit.