threads / discuss / 27504

Re: Non-error messages appears in STDERR

Subject: Re: Non-error messages appears in STDERR

## tl;dr

One message between May 30, 2011 and May 30, 2011.

replies: 0people: 1as markdown or json

Jonathan Nieder· May 30, 2011, 20:29 UTC · lore
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

← back to recent threads