Re: [PATCH 1/8] merge: make xopts a strvec
- From
Jeff King <peff@peff.net>
- Date
- Aug 31, 2023, 07:22 UTC
- Message-ID
- <20230831072216.GA3197833@coredump.intra.peff.net>
- In-Reply-To
- <20230831071230.GA3197647@coredump.intra.peff.net>
On Thu, Aug 31, 2023 at 03:12:30AM -0400, Jeff King wrote:
Show 17 quoted lines
> The "xopts" variable uses a custom array with ALLOC_GROW(). Using a > strvec simplifies things a bit. We need fewer variables, and we can also > ditch our custom parseopt callback in favor of OPT_STRVEC(). > > As a bonus, this means that "--no-strategy-option", which was previously > a silent noop, now does something useful: like other list-like options, > it will clear the list of -X options seen so far. > > Signed-off-by: Jeff King <peff@peff.net> > --- > I guess you could argue this is a backwards-incompatible change, but the > existing behavior of --no-strategy-option is so dumb that I can't > believe somebody would prefer it (plus revert/cherry-pick already use > OPT_STRVEC for their matching "-X"). > > I didn't bother adding a test since we're just re-using OPT_STRVEC code > that is used elsewhere.
I only noticed the "revert/cherry-pick" thing while sending this patch out. But it seems that it was changed recently-ish, and Phillip noted the same behavior change there (along with mentioning merge.c). So now I doubly feel this is the right thing to do. :)
-Peff