From: "Carlos Martín Nieto" <cmn@elego.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Gustaf Hendeby <hendeby@isy.liu.se>, git@vger.kernel.org
Subject: Re: git show and the --quiet option
Date: Mon, 30 May 2011 11:32:59 +0200 [thread overview]
Message-ID: <20110530093259.GA2990@bee.lab.cmartin.tk> (raw)
In-Reply-To: <7vhb8eprcb.fsf@alter.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 2538 bytes --]
On Sat, May 28, 2011 at 12:17:40PM -0700, Junio C Hamano wrote:
> Carlos Martín Nieto <cmn@elego.de> writes:
>
> >> 1c40c36b ("log: convert to parse-options"). Was this intentional?
> >
> > Very much so.
> >> ...
> > The long answer is that the log family (and git-format-patch, which
> > is where this started) never actually accepted --quiet, so it would
> > get passed down to the diff machinery. This (for complicated reasons
> > I'm not sure I comletely understand, but that have to do with the
> > internal handling of 'quiet' as 'quick') caused every second commit
> > not to show.
>
> Yes, "git format-patch" that gives empty patch for every other commit
> would have been incorrect, but "--quiet" to squelch patch output,
> especially in the context of "show" whose default is to show patch, is
> something people would naturally expect, even though admittedly it was
> doing so by accident.
>
> How does this patch look?
>
> It does not fix "git show master~10 master^..master", but instead of just
> hijacking and ignoring the --quiet option like your patch did, it actually
> flips the option the user wanted to affect from the command line.
It's fine if that's what we want to do. The reason I blocked --quiet
instead of converting it to -s is because it seemed less surprising
than passing --quiet and still getting output (if I pass --quiet, I'd
expect the application to really be quiet), which doesn't happen in
the commands that accept --quiet on purpose. Then again, the log
family doesn't make any sense without any output, so if you argue that
way, --quiet means "quieter", which makes the interface less
consistent, but I don't feel that strongly about it
So sure, if you think it helps, apply it.
>
> builtin/log.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/builtin/log.c b/builtin/log.c
> index 27849dc..224b167 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -107,6 +107,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
> PARSE_OPT_KEEP_DASHDASH);
>
> argc = setup_revisions(argc, argv, rev, opt);
> + if (quiet)
> + rev->diffopt.output_format |= DIFF_FORMAT_NO_OUTPUT;
>
> /* Any arguments at this point are not recognized */
> if (argc > 1)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2011-05-30 9:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-28 16:53 git show and the --quiet option Gustaf Hendeby
2011-05-28 17:26 ` Carlos Martín Nieto
2011-05-28 18:03 ` Gustaf Hendeby
2011-05-29 13:24 ` Carlos Martín Nieto
2011-05-28 19:17 ` Junio C Hamano
2011-05-30 9:32 ` Carlos Martín Nieto [this message]
2011-06-02 18:26 ` Drew Northup
2011-06-05 23:13 ` Carlos Martín Nieto
2011-05-28 17:55 ` Junio C Hamano
2011-05-28 18:27 ` Junio C Hamano
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=20110530093259.GA2990@bee.lab.cmartin.tk \
--to=cmn@elego.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hendeby@isy.liu.se \
/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).