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

Re: [PATCH] git-apply: add --quiet flag

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2021, 09:16 UTC
Message-ID
<xmqqsg3aahw7.fsf@gitster.g>
In-Reply-To
<xmqq35vac0vq.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Jerry Zhang <jerry@skydio.com> writes:
>
>> Replace OPT_VERBOSE with OPT_VERBOSITY.
>
> While it is not an incorrect statement, it is odd to have such an
> implementation detail nobody cares as the first thing in the log
> message, though.
>
>> This adds a --quiet flag to "git apply" so
>> the user can turn down the verbosity.
>
> Sure, I think you can do "apply --no-verbose" to do the same thing
> without any change, but we introduced VERBOSITY to replace VERBOSE
> exactly so that --verbose can be countermanded with --quiet, and
> this patch is a good example of the application of that feature.
>
> I wonder if this deserves a test.

Oh, another thing. "--quiet" with OPT_VERBOSITY is given negative values, whose magnitude may be used to express "even more quiet". This is different from "--no-verbose" that is supported by both OPT_VERBOSITY and OPT_VERBOSE that resets the variable to 0.

So use of OPT_VERBOSITY() to support both --verbose and --quiet is good, but you'd need to audit the way the verbosity variable is used by the code. "if (verbose) perform_verbosely()" would have to be rewritten as "if (verbose > verbosity_level) perform_verbosely()" or something like that, as the "verbose" variable can take a negative value to mean "less silent than the usual 0".

Previous: Junio C HamanoNext: Jerry Zhang
Message 3 of 6 in “git-apply: add --quiet flag”
  1. git-apply: add --quiet flagJerry Zhang, Apr 27, 2021
  2. Junio C HamanoApr 28, 2021
  3. Junio C HamanoApr 28, 2021
  4. Jerry ZhangApr 28, 2021
  5. git-apply: add --quiet flagJerry Zhang, Jul 28, 2021
  6. Jerry ZhangDec 11, 2021

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.