fatal output from git-show really wants a terminal
- From
Tim Olsen <tim@brooklynpenguin.com>
- Date
- Dec 10, 2008, 16:01 UTC
- Message-ID
- <ghop5d$qud$1@ger.gmane.org>
It appears that when outputting a fatal error, git-show will choose stdout over stderr if stdout is a terminal and stderr is not. How do I redirect the error but still allow stdout to be displayed?
~/git$ mkdir test
~/git$ cd test
~/git/test$ git init
~/git/test$ git show 12345
fatal: ambiguous argument '12345': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
~/git/test$ git show 12345 2> /dev/null
fatal: ambiguous argument '12345': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
~/git/test$ git show 12345 > /dev/null
fatal: ambiguous argument '12345': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
~/git/test$ git show 12345 > /dev/null 2> /dev/null
~/git/test$ git show 12345 > /tmp/out 2> /tmp/err
~/git/test$ cat /tmp/out
~/git/test$ cat /tmp/err
fatal: ambiguous argument '12345': unknown revision or path not in the working tree. Use '--' to separate paths from revisions