git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Tuncer Ayaz" <tuncer.ayaz@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
Date: Wed, 15 Oct 2008 23:15:07 -0700	[thread overview]
Message-ID: <7vtzbdjcb8.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <4ac8254d0810152254i615bca9dye0aedd8689c946e7@mail.gmail.com> (Tuncer Ayaz's message of "Thu, 16 Oct 2008 07:54:40 +0200")

"Tuncer Ayaz" <tuncer.ayaz@gmail.com> writes:

> On Thu, Oct 16, 2008 at 2:07 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> "Tuncer Ayaz" <tuncer.ayaz@gmail.com> writes:
>>
>>> On Wed, Oct 15, 2008 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>> "Tuncer Ayaz" <tuncer.ayaz@gmail.com> writes:
>>>>
> Would you prefer to leave -v out?

Not at all.

Perhaps there is a deeper misunderstanding.

It makes perfect sense _at the end user interface level_ to have -v and -q
as two separate options, perhaps with "later one wins" semantics.  Another
possible semantics is "-q and -v are mutually incompatible", but I think
"later one wins" makes it much more usable from the end user's point of view.

The only thing I was objecting to was your repeated (verbose || !quiet)
expression in the _implementation_, which would have been much easier to
read and maintain, if it were expressed as a single variable "verbosity"
that can have one of three values.

IOW,

	static enum { QUIET, NORMAL, VERBOSE } verbosity = NORMAL;
        ...

        	if (!strcmp("--quiet", arg))
                	verbosity = QUIET;
		else if (!strcmp("--verbose", arg))
                	verbosity = VERBOSE;
		else ...

	...
                if (verbosity > QUIET)
                	print informational message;
		if (verbosity > NORMAL)
                	print verbose message;

See?

  reply	other threads:[~2008-10-16  6:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 21:42 [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose tuncer.ayaz
2008-10-13 22:13 ` Junio C Hamano
2008-10-13 22:29   ` Tuncer Ayaz
     [not found]     ` <4ac8254d0810151047p7e12e8efk6fea666d2ac85f0f@mail.gmail.com>
     [not found]       ` <7vy70p3cga.fsf@gitster.siamese.dyndns.org>
     [not found]         ` <4ac8254d0810151220l48b81325yf3aca48cda49ef3a@mail.gmail.com>
     [not found]           ` <7vprm1pfmd.fsf@gitster.siamese.dyndns.org>
2008-10-16  5:54             ` Tuncer Ayaz
2008-10-16  6:15               ` Junio C Hamano [this message]
2008-10-16 20:08                 ` Tuncer Ayaz
  -- strict thread matches above, loose matches on Subject: below --
2008-10-12 16:54 Tuncer Ayaz
2008-10-12 20:08 ` Shawn O. Pearce
2008-10-12 20:29   ` Tuncer Ayaz
2008-10-12 21:31   ` Tuncer Ayaz
2008-10-12 21:36     ` Tuncer Ayaz
2008-10-13 21:03       ` Tuncer Ayaz
2008-10-13 21:06         ` Shawn O. Pearce
2008-10-13 21:12           ` Tuncer Ayaz
2008-10-13 21:13             ` Shawn O. Pearce
2008-10-13 21:44               ` Tuncer Ayaz

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=7vtzbdjcb8.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tuncer.ayaz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).