Skip to contentSkip to conversation

git push writes to stderr instead of stdout on success

BUG Marat Radchenko 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 1 line · Marat Radchenko

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

#2 lore raw
Quoted 6 lines · Jeff King
Quoted 1 line · Marat Radchenko

git push writes to stderr instead of stdout

That's by design.

Quoted 8 lines

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.