git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Matthew Caron" <Matt.Caron@redlion.net>,
	"Carlos Martín Nieto" <cmn@elego.de>,
	git@vger.kernel.org
Subject: Re: I think git show is broken
Date: Tue, 28 Aug 2012 18:45:50 -0400	[thread overview]
Message-ID: <20120828224550.GA21940@sigill.intra.peff.net> (raw)
In-Reply-To: <7v4nnmzlsl.fsf@alter.siamese.dyndns.org>

On Tue, Aug 28, 2012 at 03:36:26PM -0700, Junio C Hamano wrote:

> > As a result, the flag would have no effect in "git log -p
> > --quiet" or "git show --quiet".  Fix it by setting the
> > format flag before the call to setup_revisions.
> 
> This also means that
> 
> 	git show --name-status --quiet
> 
> will start erroring out, if I am not recalling what diff_setup_done()
> does.  Which pretty much means "--quiet" given to the "log" family
> is truly a synonym to "-s", as the error condition that triggers is
> exactly the same for this:
> 
> 	git show --name-status -s
> 
> which is fine, I think.

Yes, I noticed that. I think it is fine for "--quiet" to be a true
synonym for "-s" here.

Though I am puzzled why we would error out on "--name-status -s" but not
"--patch -s". What is the difference between "--name-status" and
"--patch" here? Shouldn't "-s" override all formatting options?

And one final thing I noticed that is probably not worth the trouble to
fix: the position of "-s" is independent of its effect. Normally options
which override each other would be position dependent, so:

  git log --relative-date --date=local

and

  git log --date=local --relative-date

would both throw away the first option and let the latter take effect.
But doing:

  git log --patch -s

and

  git log -s --patch

will always have "-s" take over. I don't think it's a huge deal, and
fixing it would be a pain. We'd have to take NO_OUTPUT out of the
bit-field and make it a special option, and fix any callers who try to
be clever about recognizing NO_OUTPUT as a specifically-given option.
And then for "--quiet", we'd have to handle it at its proper spot on the
command-line, which would mean converting log's parse-options invocation
to be step-wise. Probably not worth it for a minor bit of consistency
that nobody has actually complained about.

-Peff

      reply	other threads:[~2012-08-28 22:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 17:38 I think git show is broken Matthew Caron
2012-08-28 17:48 ` Matthew Caron
2012-08-28 21:29   ` Jeff King
2012-08-28 22:36     ` Junio C Hamano
2012-08-28 22:45       ` Jeff King [this message]

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=20120828224550.GA21940@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matt.Caron@redlion.net \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).