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.