Re: [PATCH 2/2] bloom: enable multiple pathspec bloom keys
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 1, 2025, 15:19 UTC
- Message-ID
- <xmqqo6u4kkg0.fsf@gitster.g>
- In-Reply-To
- <C8E0D62E-11B1-4921-AD4C-2905F10E07B6@gmail.com>
Lidong Yan <yldhome2d2@gmail.com> writes:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: >> Totally outside the topic, but I wonder if we can further optimize >> by adding an early rejection using .nowildcard_len? Instead of >> allowing a wildcarded "dir/*" pathspec element from disabling the >> Bloom filter altogether, we could say "dir/ is not possibly altered, >> so there may be dir/A, dir/B, etc., in the directory, nothing that >> would match dir/* wildcard would have been modified", couldn't we? > > I think, except for PATHSPEC_EXCLUDE, all other pathspec magic flags > could potentially be optimized using .nowildcard_len by restricting checks to > just the dir/ part of each pathspec item.
A good observation.
I do not know about icase; though. Asking about "Dir/Path" and getting "Dir/ or Dir/Path cannot possibly be in the set of paths that were modified" from the changed-path Bloom filter would not help us optimize the tree comparison out, when we do not want to miss modifications for "dir/path".
Show 8 quoted lines
> Here;s are all possible pathspec magic > #define PATHSPEC_FROMTOP (1<<0) > #define PATHSPEC_MAXDEPTH (1<<1) > #define PATHSPEC_LITERAL (1<<2) > #define PATHSPEC_GLOB (1<<3) > #define PATHSPEC_ICASE (1<<4) > #define PATHSPEC_EXCLUDE (1<<5) > #define PATHSPEC_ATTR (1<<6)