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

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

From
Wincent Colaiuta <win@wincent.com>
Date
Aug 12, 2007, 16:57 UTC
Message-ID
<8C80CB6C-83A5-437D-9360-AC93B73EAA54@wincent.com>
In-Reply-To
<46BF04F0.5020304@midwinter.com>
El 12/8/2007, a las 15:02, Steven Grimm escribió:
Show 13 quoted lines
> David Kastrup wrote:
>> I think I would call that a mistake.  However, I don't see that  
>> fixing
>> it would actually be useful: if a pager gets called, this means that
>> git-diff might die with SIGPIPE (when the user quits the pager), and
>> that in turn has pretty much no meaning.  So one really needs to
>> redirect the output, anyway.
>>
>
> It does sort of make one wonder, though, if there's much point ever  
> launching a pager when git-diff is run with --quiet -- it will  
> never produce any output to page, so running a pager is guaranteed  
> to always be a waste of cycles.

Yes, I thought the same thing when I read in the initial release notes (<http://www.kernel.org/pub/software/scm/git/docs/ RelNotes-1.5.1.txt>) that the "--quiet" option was explicitly "meant for scripted use", where naturally you don't want or need a pager... turns out I was writing a script, you see, and I wanted to test the commands out manually to be sure they did what I thought they would...

But as you say, refactoring this to bypass the pager when "--quiet" is passed may be unpleasantly complicated.

Cheers, Wincent

Previous: David KastrupNext: Steffen Prohaska
Message 7 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.