threads / bug / 36700

[BUG] git push writes to stderr instead of stdout on success

Subject: [BUG] git push writes to stderr instead of stdout on success

## tl;dr

3 messages between May 19, 2014 and May 19, 2014.

replies: 2people: 2as markdown or json

Marat Radchenko· May 19, 2014, 15:03 UTC · lore
`git push` writes to stderr instead of stdout
Steps to reproduce:
  mkdir foo
  cd foo
  git init
  echo foo > fo
  git add -A
  git commit -am "foo"
  git push . HEAD:refs/heads/newbranch 2>out
Expected: `out` file is empty
Actual: `out` file contents:
To .
 * [new branch]      HEAD -> newbranch
Jeff King· May 19, 2014, 15:49 UTC · re: Marat Radchenko · lore

Re: [BUG] git push writes to stderr instead of stdout on success

On Mon, May 19, 2014 at 07:03:58PM +0400, Marat Radchenko wrote:
> `git push` writes to stderr instead of stdout
That's by design.

Which one is correct is largely a matter of philosophy / mental model. This case has been discussed before:

  http://thread.gmane.org/gmane.comp.version-control.git/180673

Keep in mind also that "git push --porcelain" does go to stdout and is machine-parsed, so no other messages can go to stdout when that option is enabled.

-Peff
Marat Radchenko· May 19, 2014, 16:43 UTC · re: Jeff King · lore

Re: [BUG] git push writes to stderr instead of stdout on success

On Mon, May 19, 2014 at 11:49:09AM -0400, Jeff King wrote:
Show 14 quoted lines
> On Mon, May 19, 2014 at 07:03:58PM +0400, Marat Radchenko wrote:
> 
> > `git push` writes to stderr instead of stdout
> 
> That's by design.
> 
> Which one is correct is largely a matter of philosophy / mental model.
> This case has been discussed before:
> 
>   http://thread.gmane.org/gmane.comp.version-control.git/180673
> 
> Keep in mind also that "git push --porcelain" does go to stdout and is
> machine-parsed, so no other messages can go to stdout when that option
> is enabled.
Oh, missed --porcelain switch. Thanks.

← back to recent threads