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

Re: Regression in `git diff --quiet HEAD` when a new file is staged

From
Jeff King <peff@peff.net>
Date
Oct 18, 2025, 09:42 UTC
Message-ID
<20251018094245.GB1060824@coredump.intra.peff.net>
In-Reply-To
<918E56B8-7009-4E8E-A98E-AC5B9CE4DD7C@gmail.com>
On Sat, Oct 18, 2025 at 09:04:40AM +0800, Lidong Yan wrote:
> I believe we can move Peff’s code from diff_flush() to diff_flush_patch_quiet().
> However, I'm unsure whether we should remove the dry-run logic. In dry-run
> mode, we would halt as early as possible in xdl_diff by using quick_consume().
Yeah, exactly.

I am OK to put the /dev/null code into diff_flush_patch_quiet(). That would give all callers the same belt-and-suspenders protection.

The patch I posted put it where it was because that's where it was prior to b55e6d36eb. It is essentially a revert (because I only wanted one hunk I didn't call "git revert", but rather did a reversed patch application).

But after that revert, I think it would be reasonable to move the code on top (with the justification that it is helping the other caller of the _quiet function).

-Peff
Previous: Lidong YanNext: Jeff King
Message 10 of 27 in “Regression in `git diff --quiet HEAD` when a new file is staged”
  1. Jake ZimmermanOct 17, 2025
  2. Jeff KingOct 17, 2025
  3. diff: restore redirection to /dev/null for diff_from_contentsJeff King, Oct 17, 2025
  4. Junio C HamanoOct 17, 2025
  5. Johannes SchindelinOct 19, 2025
  6. Jeff KingOct 21, 2025
  7. Johannes SchindelinOct 17, 2025
  8. Junio C HamanoOct 17, 2025
  9. Lidong YanOct 18, 2025
  10. Jeff KingOct 18, 2025
  11. Jeff KingOct 18, 2025
  12. Junio C HamanoOct 18, 2025
  13. Jeff KingOct 21, 2025
  14. Junio C HamanoOct 21, 2025
  15. Lidong YanOct 22, 2025
  16. Jeff KingOct 22, 2025
  17. Lidong YanOct 22, 2025
  18. Junio C HamanoOct 22, 2025
  19. Junio C HamanoOct 22, 2025
  20. Jeff KingOct 22, 2025
  21. Junio C HamanoOct 22, 2025
  22. Jeff KingOct 23, 2025
  23. Jeff KingOct 23, 2025
  24. Junio C HamanoOct 23, 2025
  25. Junio C HamanoOct 22, 2025
  26. Lidong YanOct 23, 2025
  27. Junio C HamanoOct 23, 2025

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.