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

Re: [PATCH] Don't use the pager when running "git diff --check"

From
Wincent Colaiuta <win@wincent.com>
Date
Dec 14, 2007, 07:47 UTC
Message-ID
<26AEA0A9-9F15-4245-9D27-61050DA57E6F@wincent.com>
In-Reply-To
<7vmysdx3la.fsf@gitster.siamese.dyndns.org>
El 14/12/2007, a las 6:11, Junio C Hamano escribió:
Show 23 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> On Thu, Dec 13, 2007 at 08:45:38PM +0100, Wincent Colaiuta wrote:
>>
>>> In 89d07f75 "git diff" learnt to not run the pager if the user  
>>> passes
>>> the --exit-code switch. This commit does the same for the --check
>>> switch for the same reason: we want the user to get the exit status
>>> from "git diff", not the pager.
>>
>> But --check is also producing useful output, which might need  
>> paged. So
>> you are sacrificing existing interactive use of --check for  
>> scriptable
>> exit-code uses. If you really want the exit code, why not "git diff
>> --check --exit-code"?
>>
>> OTOH, I am not too sad to lose the paging behavior; it would take  
>> quite
>> a few whitespace errors to scroll off the screen.
>
> You are right.  While I do not personally miss paging output, it is a
> regression not to page --check output by default.

I thought this was ok because "git diff --exit-code" also produces useful output and also turns off the pager.

Show 7 quoted lines
> By the way, there is no reason to make --check and --exit-code  
> mutually
> exclusive either.  You could say with --exit-code the command will  
> exit
> with status 01 or'ed in if trees are not identical, and with --check  
> the
> command will exit with status 02 or'ed in.
Yes, this sounds fine to me.

Cheers, Wincent

Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 24 in “"diff --check" and whitespace enhancements”
  1. 0/5 "diff --check" and whitespace enhancementsWincent Colaiuta, Dec 13, 2007
  2. 1/5 "diff --check" should affect exit statusWincent Colaiuta, Dec 13, 2007
  3. 2/5 New version of pre-commit hookWincent Colaiuta, Dec 13, 2007
  4. 3/5 Unify whitespace checkingWincent Colaiuta, Dec 13, 2007
  5. 4/5 Make "diff --check" output match "git apply"Wincent Colaiuta, Dec 13, 2007
  6. 5/5 Add tests for "git diff --check" with core.whitespace optionsWincent Colaiuta, Dec 13, 2007
  7. Junio C HamanoDec 14, 2007
  8. Junio C HamanoDec 14, 2007
  9. Andreas EricssonDec 13, 2007
  10. Junio C HamanoDec 14, 2007
  11. Wincent ColaiutaDec 14, 2007
  12. Jakub NarebskiDec 14, 2007
  13. Wincent ColaiutaDec 14, 2007
  14. Jakub NarebskiDec 14, 2007
  15. Don't use the pager when running "git diff --check"Wincent Colaiuta, Dec 13, 2007
  16. Jeff KingDec 14, 2007
  17. Junio C HamanoDec 14, 2007
  18. Junio C HamanoDec 14, 2007
  19. Wincent ColaiutaDec 14, 2007
  20. Junio C HamanoDec 14, 2007
  21. Wincent ColaiutaDec 14, 2007
  22. Junio C HamanoDec 14, 2007
  23. Junio C HamanoDec 13, 2007
  24. Junio C HamanoDec 14, 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.