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

Re: parse-options does not recognize "unspecified" behavior

From
Jeff King <peff@peff.net>
Date
Mar 17, 2016, 05:40 UTC
Message-ID
<20160317054047.GA3457@sigill.intra.peff.net>
In-Reply-To
<CAPig+cSmQpt3u+1PPFD6CP9TF58R6NR=KCgC1dik9U=deaeCkA@mail.gmail.com>
On Thu, Mar 17, 2016 at 01:32:41AM -0400, Eric Sunshine wrote:
Show 20 quoted lines
> On Wed, Mar 16, 2016 at 9:43 PM, Jeff King <peff@peff.net> wrote:
> > Arguably cmd_commit() should be using OPT_BOOL instead of OPT__VERBOSE,
> > as there is no such thing as "verbose > 1" here. But I don't think there
> > is any real user-facing consequence of that (however, given Eric's
> > suggestion, I suspect it would make Pranit's problem just go away, as it
> > assigns rather than increments; IOW, it does the thing Eric was
> > suggestion OPT__VERBOSE to do).
> 
> Actually, Pranit's previous version of the patch did treat verbosity
> as a boolean, but then SZEDER pointed out this bit from
> git-commit.txt:
> 
>     --verbose::
>         ...
>         If specified twice, show in addition the unified diff between
>         what would be committed and the worktree files, i.e. the unstaged
>         changes to tracked files.
> 
> which is what led us to the current discussion about wanting an
> "unspecified" value for OPT__VERBOSE.

Ah, thanks. I looked for something like that in builtin/commit.c and didn't see us using verbose as anything but a boolean. But we pass it into wt_status, which does look at "s->verbose > 1".

Sorry for the noise (and probably I should stop participating in this discussion without having read all of the backstory!).

-Peff
Previous: Eric SunshineNext: SZEDER Gábor
Message 13 of 18 in “parse-options does not recognize "unspecified" behavior”
  1. Pranit BauvaMar 16, 2016
  2. Jeff KingMar 16, 2016
  3. Pranit BauvaMar 16, 2016
  4. Jeff KingMar 16, 2016
  5. Eric SunshineMar 16, 2016
  6. Pranit BauvaMar 16, 2016
  7. Jeff KingMar 16, 2016
  8. Stefan BellerMar 16, 2016
  9. Jeff KingMar 16, 2016
  10. Stefan BellerMar 16, 2016
  11. Jeff KingMar 17, 2016
  12. Eric SunshineMar 17, 2016
  13. Jeff KingMar 17, 2016
  14. SZEDER GáborMar 19, 2016
  15. Pranit BauvaMar 19, 2016
  16. SZEDER GáborMar 25, 2016
  17. Pranit BauvaMar 25, 2016
  18. Pranit BauvaMar 16, 2016

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.