git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Non-error messages appears in STDERR

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 30, 2011, 20:29 UTC
Message-ID
<20110530202942.GA14913@elie>
In-Reply-To
<86adad09-bba9-4415-834c-c004071fd9c2@l14g2000pro.googlegroups.com>
Hi,
Pok Man Lau wrote:
Show 12 quoted lines
> I am writing a class library to wrap bin\git.exe and trying to be a
> bit more accurate on error handling. Here are something interesting I
> found so far with git version 1.7.2.3.msysgit.0
>
> Some of the command output returned by git.exe appeared to be STDERR
> instead of STDOUT even they are not error message.
>
> For example:
> checkout <branch_name>
>
> I would expected the message "Switched to branch '<branch_name>'" to
> be a STDOUT, but it appears to be STDERR.

Yes, generally speaking the intent is the "result" or output that could be conceivably parsed will go to stdout, while progress information goes to stderr.

I think it would make sense to document this somewhere, e.g., in the "git help cli" text. Do you think that's the right place? Any ideas for wording?

Thanks much, Jonathan

Message 1 of 1 in “Re: Non-error messages appears in STDERR”
  1. Jonathan NiederMay 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.