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

Re: --exit-code (and --quiet) broken in git-diff?

From
Steffen Prohaska <prohaska@zib.de>
Date
Aug 12, 2007, 11:33 UTC
Message-ID
<7C233CA0-D6A4-42F2-B072-B04B1874D991@zib.de>
In-Reply-To
<46BED5AA.7050900@lsrfire.ath.cx>
On Aug 12, 2007, at 11:40 AM, René Scharfe wrote:
Show 7 quoted lines
>
> git diff passes the output through your pager by default, so you  
> see the
> exit code of that instead of diff's.  Set PAGER=cat or redirect the
> output to /dev/null to get rid of it.
>
> A test case for diff would be nice regardless, though. :)

Which is not that easy, because of the redirections done by test-lib.sh. I think git-diff needs a tty to exhibit the wrong behaviour, which it doesn't get from test-lib if run in standard mode (non verbose).

I tried to write a test case once, but after it got more and more complex, I was too lazy to complete it.

	Steffen
Previous: Wincent ColaiutaNext: René Scharfe
Message 8 of 12 in “--exit-code (and --quiet) broken in git-diff?”
  1. Wincent ColaiutaAug 11, 2007
  2. René ScharfeAug 12, 2007
  3. Wincent ColaiutaAug 12, 2007
  4. David KastrupAug 12, 2007
  5. Steven GrimmAug 12, 2007
  6. David KastrupAug 12, 2007
  7. Wincent ColaiutaAug 12, 2007
  8. Steffen ProhaskaAug 12, 2007
  9. diff: don't run pager if user asked for a diff style exit codeRené Scharfe, Aug 12, 2007
  10. Wincent ColaiutaAug 13, 2007
  11. David KastrupAug 13, 2007
  12. Junio C HamanoAug 13, 2007

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.