From: "Shawn O. Pearce" <spearce@spearce.org>
To: Albert Astals Cid <aacid@kde.org>,
Junio C Hamano <gitster@pobox.com>, Nicolas Pitre <nico@cam.org>
Cc: Pau Garcia i Quiles <pgquiles@elpauer.org>, git@vger.kernel.org
Subject: Re: Making git push output quieter
Date: Wed, 5 Aug 2009 12:26:58 -0700 [thread overview]
Message-ID: <20090805192658.GI1033@spearce.org> (raw)
In-Reply-To: <200908052113.06373.aacid@kde.org>
Albert Astals Cid <aacid@kde.org> wrote:
> A Dimecres, 5 d'agost de 2009, Pau Garcia i Quiles va escriure:
> > On Tue, Aug 4, 2009 at 11:27 PM, Albert Astals Cid<aacid@kde.org> wrote:
> > > Hi, at KDE we are starting to try to use git and one of the things that's
> > > bothering me is that git push is too verbose for our scripts.
...
> > Have you tried redirecting only stdout to /dev/null, and keeping
> > stderr to yourself ?
>
> Everything goes to stderr.
Sadly our use of isatty to determine if progress/verbosity should
be used is inconsistent. pack-objects.c, which is what you are
talking about above, is using stderr to determine if progress should
be enabled, but other code like transport.c, which is used on the
client side, is using stdout. Hence the suggestion above to redirect
stdout to /dev/null to try and shutoff the spew.
$ git grep isatty
builtin-commit.c: if (isatty(0))
builtin-config.c: stdout_is_tty = isatty(1);
builtin-pack-objects.c: progress = isatty(2);
builtin-revert.c: if (isatty(0))
builtin-shortlog.c: if (!nongit && !rev.pending.nr && isatty(0))
builtin-unpack-objects.c: quiet = !isatty(2);
color.c: stdout_is_tty = isatty(1);
compat/winansi.c: if (!isatty(fileno(stream)))
compat/winansi.c: if (!isatty(fileno(stream)))
pack-redundant.c: if (!isatty(0)) {
pager.c: if (!isatty(1))
pager.c: if (isatty(2))
transport.c: args.no_progress = args.quiet || (!transport->progress && !isatty(1));
wt-status.c: * will have checked isatty on stdout).
I'm thinking this might be a reasonable patch to apply, Junio/Nico?
--8<--
pack-objects: Display progress only if stdout is tty
Client transports underneath git fetch display progress output only
if stdout is a tty, allowing redirection of stdout to /dev/null (or
a pipe) to silence progress but still report actual errors on stderr.
Doing the same in pack-objects means push, bundle creation and
repack can use the same trick to silence noisy progress progress,
but still obtain real errors.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
builtin-pack-objects.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 961b639..0b9234a 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -2110,7 +2110,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (!pack_compression_seen && core_compression_seen)
pack_compression_level = core_compression_level;
- progress = isatty(2);
+ progress = isatty(1);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
--
1.6.4.70.g9c084
--
Shawn.
next prev parent reply other threads:[~2009-08-05 19:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 21:27 Making git push output quieter Albert Astals Cid
2009-08-04 22:20 ` Pau Garcia i Quiles
2009-08-05 19:13 ` Albert Astals Cid
2009-08-05 19:26 ` Shawn O. Pearce [this message]
2009-08-05 19:51 ` Nicolas Pitre
2009-08-05 20:19 ` Jeff King
2009-08-05 20:22 ` [RFC/PATCH 1/3] push: add --quiet flag Jeff King
2009-08-05 20:22 ` [PATCH 2/3] transport: pass "quiet" flag to pack-objects Jeff King
2009-08-05 20:23 ` [PATCH 3/3] transport: don't show push status if --quiet is given Jeff King
2009-08-05 20:27 ` Sverre Rabbelier
2009-08-05 20:29 ` Avery Pennarun
2009-08-05 20:30 ` Sverre Rabbelier
2009-08-05 20:39 ` Junio C Hamano
2009-08-05 20:48 ` Jeff King
2009-08-05 21:01 ` Junio C Hamano
2009-08-05 21:17 ` Jeff King
2009-08-31 18:33 ` Sebastian Pipping
2009-08-31 19:28 ` Jeff King
2009-08-31 19:39 ` Sebastian Pipping
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=20090805192658.GI1033@spearce.org \
--to=spearce@spearce.org \
--cc=aacid@kde.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.org \
--cc=pgquiles@elpauer.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.