Web lists-archives.com

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

On Wed, Apr 19, 2017 at 3:11 PM, René Scharfe <l.s.r@xxxxxx> wrote:
> Am 19.04.2017 um 09:00 schrieb Ævar Arnfjörð Bjarmason:
>> On Wed, Apr 19, 2017 at 12:29 AM, René Scharfe <l.s.r@xxxxxx> wrote:
>>> Setting PARSE_OPT_NONEG takes away the ability to toggle the affected
>>> option.  E.g. git clone would reject --checkout.  Currently users can
>>> specify --no- options as defaults in aliases and override them on the
>>> command line if needed, with the patch that won't be possible anymore.
>>> PARSE_OPT_NONEG should only be used for options where a negation doesn't
>>> make sense, e.g. for the --stage option of checkout-index.
>> That's a bad bug, I don't know whether to be surprised or not that we
>> had no tests for this :)
>> I thought I was just disabling --no-no-checkout for --no-checkout, not
>> --checkout, but didn't notice the subtleties of the special case
>> handling for --no-* in parse-options.c, thanks.
> I'm confused.  What's the bug here?
> --no-no-checkout is undocumented; Jacob's patch addresses it. --no-checkout
> is the documented form.  Negation allows --checkout to be used as well, with
> the opposite meaning to --no-checkout.  Turning off negation with
> PARSE_OPT_NONEG forbids --checkout to be used.
> Perhaps the issue is that a single line of documentation is not enough
> ("PARSE_OPT_NONEG: says that this option cannot be negated")?

I mean a bug in my patch, i.e. I meant to remove --no-no-OPT in cases
of --no-OPT but also removed --OPT unintentionally, but anyway, let's
drop this one, Jacob's patch is better.