git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] parse-options: disallow double-negations of options starting with no-

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 19, 2017, 21:23 UTC
Message-ID
<CA+P7+xoMMPHwkaDiZWjD5gCoKh4iWGaVQ+206i8kS9aFM5zcEg@mail.gmail.com>
In-Reply-To
<CA+P7+xpahRim9H1cHuHmzjGggYt2qbvxrDYyi+ri0QsDEUAkcw@mail.gmail.com>
On Wed, Apr 19, 2017 at 2:22 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 33 quoted lines
> On Wed, Apr 19, 2017 at 2:00 PM, Jeff King <peff@peff.net> wrote:
>> On Wed, Apr 19, 2017 at 01:54:06PM -0700, Jacob Keller wrote:
>>
>>> This is why it's an RFC. I don't really feel that it's too much of a
>>> problem. As for the reason why I thought it might want a flag itself
>>> is because of concerns raised earlier that we might have something
>>> liek
>>>
>>> OPT_BOOL( ... "no-stage" ...)
>>> OPT_INT(... "stage" ....)
>>>
>>> or something already which might be broken and the only proper way to
>>> disable no-stage is no-no-stage?
>>>
>>> Is this actually a concern? I thought this was a comment raised by you
>>> earlier as an objection to a change unless we specifically flagged
>>> them as OPT_NEGBOOL()
>>
>> I think the breakage in that case would be caused by "--no-stage" taking
>> over "--stage" as well. And your patch doesn't change that; it happened
>> already in 2012.
>>
>> Your patch only affects the --no-no- form, which I think we would never
>> want. I don't think it needs callers to trigger it explicitly.
>>
>> -Peff
>
> Right, I was just thinking in the weird cause were we *do* have a
> "no-option" that does want the "no-no-option" to negate it. Maybe this
> isn't ever a thing and we don't need to worry at all..?
>
> Thanks,
> Jake

And in this case the same PARSE_OPT_FLAG would be used to also not do the "no-option" negates to "option" as well, since the options point would be something liek "this option starts with no- but negates normally even though we don't normally allow that"

Previous: Jacob KellerNext: Jeff King
Message 8 of 9 in “parse-options: disallow double-negations of options starting with no-”
  1. parse-options: disallow double-negations of options starting with no-Jacob Keller, Apr 19, 2017
  2. Ævar Arnfjörð BjarmasonApr 19, 2017
  3. René ScharfeApr 19, 2017
  4. Jeff KingApr 19, 2017
  5. Jacob KellerApr 19, 2017
  6. Jeff KingApr 19, 2017
  7. Jacob KellerApr 19, 2017
  8. Jacob KellerApr 19, 2017
  9. Jeff KingApr 19, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.