Re: how to suppress progress percentage in git-push
- From
Jeff King <peff@peff.net>
- Date
- Nov 24, 2009, 03:07 UTC
- Message-ID
- <20091124030742.GA32029@coredump.intra.peff.net>
- In-Reply-To
- <20091124011339.GA18003@debian.b2j>
On Tue, Nov 24, 2009 at 09:13:39AM +0800, bill lam wrote:
Show 7 quoted lines
> 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