Re: [PATCH v2 6/6] last-modified: keep per-path Bloom filters for wildcard pathspecs

Junio C Hamano <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
Toon Claes <[email protected]> writes:

> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.