All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Jacob Helwig <jacob.helwig@gmail.com>,
	Jack Desert <jackdesert556@gmail.com>,
	git@vger.kernel.org
Subject: Re: Bugreport: Git responds with stderr instead of stdout
Date: Sun, 25 Apr 2010 15:22:07 -0400	[thread overview]
Message-ID: <20100425192207.GA14736@coredump.intra.peff.net> (raw)
In-Reply-To: <y2g51dd1af81004251124zc4da759dka2ceebe1d9735fd7@mail.gmail.com>

On Sun, Apr 25, 2010 at 06:24:43PM +0000, Ævar Arnfjörð Bjarmason wrote:

> On Sun, Apr 25, 2010 at 18:10, Jacob Helwig <jacob.helwig@gmail.com> wrote:
> > I can't really say if it's actually a bug, or not, but as to your
> > question about where to file a bug report: You just did.  This mailing
> > list is the correct place.
> 
> I've had some issues scripting `git fetch` because on error it'll
> print to stdout and not stderr.

Errors should go to stderr, so I imagine patches would be welcome. Which
messages went to stdout?

> Are there some general guidelines for git's utilities that they follow
> in this regard or does each tool just do its own thing?

In practice, each tool does its own thing because they evolved
differently and from different authors. I think we are slowly converging
on similar behavior, though, as people fix warts.  As to exactly what
that behavior is, I don't know that anybody has ever enumerated it
exactly. Verbose status and progress reports, especially human readable
ones, should probably always go to stderr.

The "Switched to a new branch" message that started this thread is
correct to go to stderr.  If you want to silence the message but keep
stderr open for actual errors, the right way is to use "-q".

I tend to think the only thing that should go to stdout is the "main"
output of a command. For something like "ls-files", that is obviously
the list of files. For something like "checkout", which is about
changing the repository and not about querying it, I think there is
probably nothing that makes sense on stdout.

-Peff

  reply	other threads:[~2010-04-25 19:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 18:06 Bugreport: Git responds with stderr instead of stdout Jack Desert
2010-04-25 18:10 ` Jacob Helwig
2010-04-25 18:24   ` Ævar Arnfjörð Bjarmason
2010-04-25 19:22     ` Jeff King [this message]
2010-04-25 19:32       ` Ævar Arnfjörð Bjarmason
2010-04-25 19:32         ` Jeff King
2010-06-12 16:52           ` Ævar Arnfjörð Bjarmason
2010-06-24 22:34             ` [PATCH] fetch: don't output non-errors on stderr Ævar Arnfjörð Bjarmason
2010-06-25 13:30               ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2010-06-25 17:25               ` [PATCH] " Junio C Hamano
2010-06-25 21:28                 ` Ævar Arnfjörð Bjarmason
2010-06-25 21:43                   ` Junio C Hamano
2010-06-26  6:13                     ` Jeff King
2010-06-26 12:14                       ` Ævar Arnfjörð Bjarmason
2010-06-26 13:40                         ` Tay Ray Chuan
2010-06-26 15:07                           ` Ævar Arnfjörð Bjarmason
2010-06-26 16:46                         ` Jeff King
2010-06-26 16:50                           ` Ævar Arnfjörð Bjarmason
2010-04-25 18:34   ` Bugreport: Git responds with stderr instead of stdout Jack Desert

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=20100425192207.GA14736@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jackdesert556@gmail.com \
    --cc=jacob.helwig@gmail.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 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.