All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jerry Zhang <jerry@skydio.com>
Cc: git@vger.kernel.org, ross@skydio.com, abe@skydio.com,
	brian.kubisiak@skydio.com
Subject: Re: [PATCH] git-apply: add --quiet flag
Date: Wed, 28 Apr 2021 18:16:24 +0900	[thread overview]
Message-ID: <xmqqsg3aahw7.fsf@gitster.g> (raw)
In-Reply-To: <xmqq35vac0vq.fsf@gitster.g> (Junio C. Hamano's message of "Wed, 28 Apr 2021 16:40:57 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> 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".


  reply	other threads:[~2021-04-28  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 19:41 [PATCH] git-apply: add --quiet flag Jerry Zhang
2021-04-28  7:40 ` Junio C Hamano
2021-04-28  9:16   ` Junio C Hamano [this message]
2021-04-28 18:18     ` Jerry Zhang
2021-07-28  3:22 ` [PATCH V2] " Jerry Zhang
2021-12-11  2:07   ` Jerry Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsg3aahw7.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=abe@skydio.com \
    --cc=brian.kubisiak@skydio.com \
    --cc=git@vger.kernel.org \
    --cc=jerry@skydio.com \
    --cc=ross@skydio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.