git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: bill lam <cbill.lam@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Nicolas Pitre <nico@fluxnic.net>, git <git@vger.kernel.org>
Subject: Re: how to suppress progress percentage in git-push
Date: Mon, 23 Nov 2009 22:07:42 -0500	[thread overview]
Message-ID: <20091124030742.GA32029@coredump.intra.peff.net> (raw)
In-Reply-To: <20091124011339.GA18003@debian.b2j>

On Tue, Nov 24, 2009 at 09:13:39AM +0800, bill lam wrote:

> On Mon, 23 Nov 2009, Nicolas Pitre wrote:
> > Then, during the pack-objects process, there are 3 phases: counting 
> > objects, compressing objects, and writing objects.  However in the fetch 
> 
> during git-gc it shows yet another progress 
> 
> Removing duplicate objects: 100% (256/256), done.

Thanks, this doesn't seem to have been guarded at all (but since it is
on a 2-second delay, you have to have quite a lot of loose objects or a
slow disk to trigger it).

We should apply the patch below to keep things consistent.

I also checked every other call to start_progress; everything else seems
to be guarded. Most of them were easy to trace to an isatty check,
though the one in unpack-trees is influenced by o->verbose_update. That
in turn usually corresponds to a quiet option, though merge does seem to
use it unconditionally. Maybe that should be tweaked, too?

-- >8 --
Subject: [PATCH] prune-packed: only show progress when stderr is a tty

This matches the behavior of other git programs, and helps
keep cruft out of things like cron job output.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin-prune-packed.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index be99eb0..f9463de 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -71,7 +71,7 @@ void prune_packed_objects(int opts)
 
 int cmd_prune_packed(int argc, const char **argv, const char *prefix)
 {
-	int opts = VERBOSE;
+	int opts = isatty(2) ? VERBOSE : 0;
 	const struct option prune_packed_options[] = {
 		OPT_BIT('n', "dry-run", &opts, "dry run", DRY_RUN),
 		OPT_NEGBIT('q', "quiet", &opts, "be quiet", VERBOSE),
-- 
1.6.6.rc0.249.g9b4cf.dirty

      reply	other threads:[~2009-11-24  3:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 14:53 how to suppress progress percentage in git-push bill lam
2009-11-23 15:00 ` Jeff King
2009-11-23 15:50   ` Petr Baudis
2009-11-23 16:43     ` Jeff King
2009-11-23 17:05       ` Petr Baudis
2009-11-23 19:28         ` Jeff King
2009-11-23 17:43       ` [PATCH] pack-objects: split implications of --all-progress from progress activation Nicolas Pitre
2009-11-23 18:12         ` Petr Baudis
2009-11-23 18:27           ` Nicolas Pitre
2009-11-23 19:04             ` Petr Baudis
2009-11-23 19:32         ` Jeff King
2009-11-23 16:56   ` how to suppress progress percentage in git-push Nicolas Pitre
2009-11-23 19:25     ` Jeff King
2009-11-23 19:40       ` Nicolas Pitre
2009-11-24  1:13     ` bill lam
2009-11-24  3:07       ` 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=20091124030742.GA32029@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=cbill.lam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    /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).