threads / discuss / 51380

Why is part of push origin output written to stderr?

Subject: Why is part of push origin output written to stderr?

## tl;dr

2 messages between Jun 25, 2019 and Jun 25, 2019.

replies: 1people: 2as markdown or json

Thomas Hruska· Jun 25, 2019, 15:27 UTC · lore

As seen from a basic 'git push origin master' where the last part of the output of a successful push origin is sent to stderr instead of stdout:

To host:user/something.git
    1f57f4a..1a96eab  master -> master

I don't usually think of a successful push as being a fatal error but I could be very wrong. Maybe git is trying to tell me that pushing is actually a mistake.

-- 
Thomas Hruska
CubicleSoft President

http://cubiclesoft.com/
Kevin Daudt· Jun 25, 2019, 16:26 UTC · re: Thomas Hruska · lore

Re: Why is part of push origin output written to stderr?

On Tue, Jun 25, 2019 at 08:27:20AM -0700, Thomas Hruska wrote:
Show 9 quoted lines
> As seen from a basic 'git push origin master' where the last part of the
> output of a successful push origin is sent to stderr instead of stdout:
> 
> To host:user/something.git
>    1f57f4a..1a96eab  master -> master
> 
> I don't usually think of a successful push as being a fatal error but I
> could be very wrong.  Maybe git is trying to tell me that pushing is
> actually a mistake.

Although the name implies it's used for error output, some programs also use stderr to output anything that is separate from the standard output of a program.

Curl for example show progress information on stderr to not intersperse it with the normal output of curl.

The same happens here with git. You have the regular output of git push, but any progress update is writted to stderr.

So stderr is more treated like an additional output stream rather than only reporting errors to stderr.

Hope this helps, Kevin
Show 7 quoted lines
> 
> -- 
> Thomas Hruska
> CubicleSoft President
> 
> http://cubiclesoft.com/
> 

← back to recent threads