Re: [PATCH 0/2] replay: add --update-refs option
From: Elijah Newren <hidden>
Date: 2025-09-09 19:52:31
On Tue, Sep 9, 2025 at 9:44 AM Junio C Hamano [off-list ref] wrote:
Elijah Newren [off-list ref] writes:quoted
quoted
quoted
Seems fair...but why not make --update-refs the default and add an option for those that just want the update commands?If this patch series had been sent a few months after `git replay` was introduced, I would have been fine with this series making `git replay` update the refs by default while adding an option that only outputs the commands. Unfortunately `git replay` seems to have been introduced in v2.44.0 (Feb 22, 2024), so more than 18 months ago. So even if it is marked as experimental, it's perhaps a bit late to make such a relatively big change in it?I don't think so; we marked it as experimental much more prominently than other commands -- in the .c file, and three separate places in the documentation.When we are talking about a change that breaks an established end-user expectation, it does not matter much if we wrote anything in the .c source files. The end-user facing documentation does. And as you said, "git replay -h" and "git replay --help" prominently show that the experimental nature of the command.
I should have clarified -- the .c change was specifically about making
"git replay -h" show the experimental nature of the command; if it was
just a code comment, I'd agree that it didn't matter, but it was
specifically about making the experimental status known to end users
in the short usage message:
$ git grep -2 EXPERIMENTAL '*.c'
builtin/replay.c-
builtin/replay.c- const char * const replay_usage[] = {
builtin/replay.c: N_("(EXPERIMENTAL!) git replay "
builtin/replay.c- "([--contained] --onto <newbase> |
--advance <branch>) "
builtin/replay.c- "<revision-range>..."),
$
If this new behaviour is a clear improvement for majority of use cases, I am perfectly fine with changing the default behaviour so that everybody will benefit. It may still be good to add an option to allow the users to ask for the traditional "we'll give you a list of updates you can apply as you see fit, but would not update the refs ourselves" mode, though.
Yep.