git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Romain Bignon <romain@peerfuse.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] use -q instead of redirect to /dev/null for git update-index
Date: Sun, 21 Mar 2010 06:17:17 -0700	[thread overview]
Message-ID: <7vy6hlvmoy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1269168827-18694-1-git-send-email-romain@peerfuse.org> (Romain Bignon's message of "Sun\, 21 Mar 2010 11\:53\:47 +0100")

Romain Bignon <romain@peerfuse.org> writes:

> Signed-off-by: Romain Bignon <romain@peerfuse.org>
> ---
> ...
> diff --git a/git-rebase.sh b/git-rebase.sh
> index fb4fef7..c814c30 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -389,7 +389,7 @@ else
>  fi
>  
>  # The tree must be really really clean.
> -if ! git update-index --ignore-submodules --refresh > /dev/null; then
> +if ! git update-index --ignore-submodules --refresh -q; then
>  	echo >&2 "cannot rebase: you have unstaged changes"
>  	git diff-files --name-status -r --ignore-submodules -- >&2

I don't think this is quite "identical" conversion, if that is what you
were aiming at.  But it is not even clear why you wanted to do this patch;
it is not justified with any proposed commit log message.

The original is written in such a way that you won't see any output, not
just for the "needs-update" entries, but also not for the "needs-merge"
entries; "-q" traditionally never squelched the output for the latter
kind.

Maybe in some other codepath, it might be the correct thing not to squelch
the "needs-merge" message, but because we run diff-files to show them in
the error codepath, redirecting everything to /dev/null is the right thing
to do in this particular case.

Because the patch wasn't accompanied by any explanation to justify why
this change is necessary or desirable, it forced me to study and read
through the history to come up with the two paragraph analysis above,
costing 30 minutes of my time, only to reject it.

Even if this _were_ a correct conversion, we are not gaining much (what's
the point of removing the perfectly-well-working discard-to-null?).

The above can be said to other "/dev/null to -q" patches we saw on the
list recently.  The saddest part of the story is that, the review cost
(not necessarily spent by me, but time spent by other people reviewing
patches is precious) is paid only to prevent a breakage like this patch
tries to introduce from getting accepted, without much potential reward.
Even if some of those patches turn out to be harmless, the only thing we
would have bought with the cost of reviewing is that we made sure that the
system would continue to work as before, but that is what we could have
easily done by not even looking at the patches at all.

Sadly, the cost-to-reward tradeoff is simply not worth it, unless the
patch is accompanied by necessary homework to reduce the review load.

  reply	other threads:[~2010-03-21 13:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-21 10:53 [PATCH] use -q instead of redirect to /dev/null for git update-index Romain Bignon
2010-03-21 13:17 ` Junio C Hamano [this message]
2010-03-21 17:02   ` Benjamin Meyer
2010-03-21 19:50     ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vy6hlvmoy.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=romain@peerfuse.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).