Re: [PATCH v2 6/6] last-modified: keep per-path Bloom filters for wildcard pathspecs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2026, 17:07 UTC
- Message-ID
- <xmqqtsp4a6c2.fsf@gitster.g>
- In-Reply-To
- <20260807-toon-speed-up-last-modified-v2-6-7d87bbdeaf9b@iotcl.com>
Toon Claes <toon@iotcl.com> writes:
Show 12 quoted lines
> The last-modified builtin expands the pathspec to a set of literal paths > and builds a Bloom key for each. During the walk it looks those keys up > in the commit's filter to decide whether the commit is worth diffing. > These lookups need `bloom_filter_settings` for the key hashing. > > prepare_revision_walk() runs prepare_to_use_bloom_filter() to build the > pathspec key vectors. For a pathspec that cannot be turned into a Bloom > key, such as a top-level wildcard like "*.c", that function gives up and > clears `bloom_filter_settings`. > > Restore `bloom_filter_settings` after prepare_revision_walk() so the > per-path check keeps working for wildcard pathspecs.
Should a new test or two cover a case where a pathspec with a top-level wildcard is supplied, and ensure that this restoration kicks in?
The machinery should work correctly with or without Bloom filters. Without trace instrumentation, such a test might not exhibit any behavior difference even when the filter is not restored. However, the failure scenario is specific enough to make a good test case.
Thanks.