git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Next: Boyd Stephen Smith Jr.
Message 1 of 13 in “fatal output from git-show really wants a terminal”
  1. Tim OlsenDec 10, 2008
  2. Boyd Stephen Smith Jr.Dec 10, 2008
  3. Johannes SixtDec 10, 2008
  4. Tim OlsenDec 10, 2008
  5. Boyd Stephen Smith Jr.Dec 10, 2008
  6. Boyd Stephen Smith Jr.Dec 11, 2008
  7. Jeff KingDec 11, 2008
  8. Boyd Stephen Smith Jr.Dec 11, 2008
  9. Jeff KingDec 11, 2008
  10. Junio C HamanoDec 11, 2008
  11. Junio C HamanoDec 15, 2008
  12. Junio C HamanoDec 15, 2008
  13. Jeff KingDec 15, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.