# stdout versus stderr for cmd line git

2 messages from 2013-05-08 to 2013-05-10. Participants: Michael Hunley, Jonathan Nieder.
Thread: https://gitlist.dev/t/33748

## Michael Hunley, 2013-05-08 01:48

Subject: stdout versus stderr for cmd line git
Message-ID: <CAKk5qjVoDUzeurgAL51jixXsm4rJCMCDf620vAv_Gsafk8N7iA@mail.gmail.com>
URL: https://gitlist.dev/e/CAKk5qjVoDUzeurgAL51jixXsm4rJCMCDf620vAv_Gsafk8N7iA%40mail.gmail.com

```
I have been building some automated patching scripts to update
multiple servers at once from our dev host.  In doing so I ran into
some oddities with linux command line GIT version 1.8.0-rc0, so a
couple minor revisions behind.

First, a "git pull" puts the list of branches updated onto stderr.
These are not errors and should be on stdout.  E.g.
Filtered error: From <git host>:service-framework
Filtered error:    017f911..b1f72db  patching   -> origin/patching

Ok, we can filter that out.  But worse is that actual errors in a pull
request are sent to stdout instead of standard error.  For example,
merge conflicts or pull failures because you have unstaged changes.

For now I have to merge all stdout to stderr on my git requests in my
patching script, then filter the results to find the real errors.

Can we please make it so all actual errors appear on stderr, but not non-errors?

If this was fixed in 1.8.2 latest, please forgive as I am running fast
and furious to get this available tonight.

thanks

```

## Jonathan Nieder, 2013-05-10 03:28

Subject: Re: stdout versus stderr for cmd line git
Message-ID: <20130510032843.GA12036@elie>
URL: https://gitlist.dev/e/20130510032843.GA12036%40elie
In-Reply-To: <CAKk5qjVoDUzeurgAL51jixXsm4rJCMCDf620vAv_Gsafk8N7iA@mail.gmail.com>

```
Hi,

Michael Hunley wrote:

> Ok, we can filter that out.  But worse is that actual errors in a pull
> request are sent to stdout instead of standard error.  For example,
> merge conflicts or pull failures because you have unstaged changes.

Yes, errors and progress output should go to stderr.  The git-pull.sh
script is pretty old and is probably just a bit sloppy about
forgetting to redirect output from "echo".  Patches welcome.
(See Documentation/SubmittingPatches for details.)

Hope that helps,
Jonathan

```
