git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <carlos@cmartin.tk>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Carlos Martín Nieto" <cmn@elego.de>,
	git@vger.kernel.org,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>
Subject: Re: [PATCH] format-patch: don't pass on the --quiet flag
Date: Wed, 13 Apr 2011 11:26:20 +0200	[thread overview]
Message-ID: <20110413092620.GA3649@bee.lab.cmartin.tk> (raw)
In-Reply-To: <7vk4ezpacr.fsf@alter.siamese.dyndns.org>

On Tue, Apr 12, 2011 at 11:56:20AM -0700, Junio C Hamano wrote:
> Carlos Martín Nieto <cmn@elego.de> writes:
> 
> >> A patch to make --quiet not to squelch the patch output, and instead
> >> silence any progress output would be a good addition.
> >
> > Something like this? I guess the only use case would be together with
> > -o.
> 
> When the user gives -q without giving -o to a new or an empty directory,
> the user deserves to get what was asked on the command line, so I wouldn't
> worry about this particular case.  For a casual user, it is perfectly a
> sensible thing to say "I'll eyeball; I don't have other files whose names
> begin with [0-9]{4}- in my working tree" and I don't think we need safety
> against doing that.
> 

 Agreed.

> I however wonder if we should audit other commands in the "log" family to
> see what they do when "--quiet" is given.  I know what they do currently
> is whatever they happen to do for a nonsense request, and in no way is a
> designed behaviour.  We simply did never think about that case.
> 
> For example, what should "git show master^2 next^2" do with "--quiet"?  Of
> course the standard way to squelch diff output in the output from "show"
> is to use "-s" (coming from "git diff-tree"), but giving "--quiet" should
> at least be a no-op.
> 

 We get a similar effect to format-patch, and a line disappears

    carlos@bee:~/apps/git$ git show --oneline origin/master^2 origin/next^2
    9973d93 t2021: mark a test as fixed
    diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
    index 27db2ad..5da63e9 100755
    --- a/t/t2021-checkout-overwrite.sh
    +++ b/t/t2021-checkout-overwrite.sh
    @@ -39,7 +39,7 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'
	[...] Diff here
    9db1941 Merge branch 'js/checkout-untracked-symlink'

and

    carlos@bee:~/apps/git$ git show --oneline --quiet origin/master^2 origin/next^2
    9973d93 t2021: mark a test as fixed

so we certainly should catch it.

I'm not so sure what we should do with it, though. We shouldn't
squelch all the output, because then it just makes the command useless
(though I guess the user asked for it in that case). Maybe making it
behave like a --no-diff option would make sense (i.e. pretend the user
passed -s) in order to make it behave like a prettier version of
rev-parse.

Looking at the other cmd_ functions in builtin/log.c I see:
 - reflog ignores it
 - cherry complains that it doesn't know about the option
 - log -p --quiet is the same as log
 - whatchanged --quiet shows the same as log but skips every second
   commit
 - show --quiet skips one of the commits

and I don't see any others, so whatchanged should be tought not to
skip the commits. I'll what cmd_log does differently from
cmd_whatchanged when passing options.

   cmn

  reply	other threads:[~2011-04-13  9:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11 21:07 Bug in "git diff --quiet" handling Paul Gortmaker
2011-04-11 21:35 ` Junio C Hamano
2011-04-12 15:51   ` [PATCH] format-patch: document --quiet option Carlos Martín Nieto
2011-04-12 19:07     ` Junio C Hamano
2011-04-12 19:52       ` Junio C Hamano
2011-04-13  9:29         ` Carlos Martín Nieto
2011-04-12 15:35 ` [PATCH] format-patch: don't pass on the --quiet flag Carlos Martín Nieto
2011-04-12 18:56   ` Junio C Hamano
2011-04-13  9:26     ` Carlos Martín Nieto [this message]
2011-04-13 12:10       ` [PATCH] whatchanged: always show the header Carlos Martín Nieto
2011-04-13 15:58         ` Junio C Hamano
2011-04-13 19:38           ` Carlos Martín Nieto
2011-04-14 14:28           ` [PATCH] log: convert to parse-options Carlos Martín Nieto
2011-04-14 17:08             ` Junio C Hamano
2011-04-19 12:33               ` =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?=
2011-04-20  2:38                 ` Jeff King
2011-04-20 14:51                   ` Carlos Martín Nieto

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=20110413092620.GA3649@bee.lab.cmartin.tk \
    --to=carlos@cmartin.tk \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paul.gortmaker@windriver.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).