Re: [PATCH v4 00/12] builtin/rerere: convert to use subcommands
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 16, 2026, 07:57 UTC
- Message-ID
- <avq3YHb_J8Ww6Kq7@pks.im>
- In-Reply-To
- <xmqq7bifponx.fsf@gitster.g>
On Sat, Nov 14, 2026 at 04:45:22AM -0800, Junio C Hamano wrote:
Show 27 quoted lines
> Does the new syntax introduce a subtle UI regression that does not > allow certain options before subcommands? We used to take "git > rerere --skip-locked gc", but now it has to be spelled as "git > rerere gc --skip-locked", it seems. > > I do not particularly care about the '--skip-locked' option itself, > and I personally prefer to see options after non-options as a > general CLI principle, but it seems that it is now required to give > the option after the "gc" subcommand. > > I do not know how often people run "git rerere" with these > subcommands themselves. This subtle change in the CLI may go > unnoticed in a smaller project, but because we probably have more > than a few thousand users, I am afraid that somebody will notice. > > In the transcript below, "rungit TRACK" is my short-hand to run > version of "git" from that integration branch. > > $ rungit master rerere --skip-locked gc > $ rungit next rerere --skip-locked gc > $ rungit seen rerere --skip-locked gc > error: unknown option `skip-locked' > usage: git rerere [--[no-]rerere-autoupdate] > > --[no-]rerere-autoupdate > register clean resolutions in index > $ rungit seen rerere gc --skip-locked
Yes, as documented in "builtin/rerere: use `OPT_SUBCOMMAND()`.
Unfortunately this means that we have a backwards-incompatible change because we no longer accept the "--[no-]rerere-autoupdate" flag for all subcommands. But this was arguably broken and misleading as we ignore this flag for any other subcommand aynway. So we cheat a bit and simply call it a bug that those flags were accepted in the first place.
But yes, the same is true for "--skip-locked". I was expecting more review feedback on that specific part, and was a bit surprised to get none.
As documented in the commit message, I would argue that the current status quo is just plain broken as we accept options in cases where they aren't even being used at all. For "--skip-locked" that shouldn't be much of an issue, as the flag has only just been introduced, so it's very unlikely that there's any users of it out there just yet. So now is the right moment to fix that design wart.
BUt that isn't true for the "--rerere-autoupdate" flag, which has existed for a long time already. So if this backwards-incompatible change is deemed to be too risky, then I'd adapt the code to only allow that one flag in all locations.
Patrick