Re: [PATCH v2 4/4] scalar reconfigure: add --no-maintenance option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 6, 2025, 22:16 UTC
- Message-ID
- <xmqqselhfkq8.fsf@gitster.g>
- In-Reply-To
- <3e307bf1-52ef-4280-bada-5cc50cc7a817@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 6 quoted lines
> What do you think about something of the form --maintenance=<option> > where <option> is one of these: > > * "enable" (default) runs 'git maintenance start' > * "disable" runs 'git maintenance unregister' > * "keep" does not mess with maintenance config.
I think it makes superb sense.
Certainly much less ambiguous than "--[no-]maintenance" given that we need to handle "reconfigure". Without the need to deal with "reconfigure", it certainly is attractive if we can treat it as a simple Boolean, though.
It is also tempting to just initialize the internal variable to -1 and keep using OPT_BOOL() though. Then after config and command line parsing is done, clone and register would turn -1 the user did not touch into 1 (i.e. enable is default for these two operations), while reconfigure treats -1 as "leave it as-is". It would make it very cumbersome if we ever change our mind and give a default other than "leave it as-is" to "reconfigure", but other than that minor downside, it may be easier to use from end-user's point of view.
I have no strong opinion between the two.
Thanks.