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

Re: [PATCH] setup_revisions(): turn on diffs for all-negative diff filter

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2025, 05:31 UTC
Message-ID
<xmqq7c0ka7n6.fsf@gitster.g>
In-Reply-To
<20250703224428.GB1909836@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> Argh, I forgot to add Johannes to the cc. Fortunately since then I had a
> moment to look at this, and the solution is pretty simple. So here it is
> as a patch with a test.
>
> -- >8 --
> Subject: setup_revisions(): turn on diffs for all-negative diff filter
>
> When the user gives us a diff filter like --diff-filter=D, we need to do
> a tree diff even if we're not planning to show the diff result itself,
> in order to decide whether to show the commit at all. So there's an
> explicit check of revs->diffopt.filter in setup_revisions(), and we set
> revs->diff if any bits are set.
>
> Originally that "filter" field covered both positive capital-letter
> filters (like "D") and also negative lowercase filters (like "d"), so it
> was sufficient for both cases. But later, 75408ca949 (diff-filter: be
> more careful when looking for negative bits, 2022-01-28) split the
> negative bits out into a "filter_not" field.

Ah, ouch, so the patch somehow ended up to be less careful about negative bits after all ;-)

Thanks for noticing the breakage and fixing it.
Previous: Karthik Nayak
Message 9 of 9 in “Behavior of git log --diff-filter=d”
  1. Eric SalemJul 2, 2025
  2. Re Behavior of git log --diff-filter=dK Jayatheerth, Jul 3, 2025
  3. Jeff KingJul 3, 2025
  4. Eric SalemJul 3, 2025
  5. Jeff KingJul 3, 2025
  6. setup_revisions(): turn on diffs for all-negative diff filterJeff King, Jul 3, 2025
  7. Eric SalemJul 3, 2025
  8. Karthik NayakJul 4, 2025
  9. Junio C HamanoJul 7, 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.