]> git.ipfire.org Git - thirdparty/git.git/commit
revision: expose check for paths maybe changed in Bloom filter
authorToon Claes <toon@iotcl.com>
Fri, 17 Jul 2026 15:47:00 +0000 (17:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jul 2026 20:20:57 +0000 (13:20 -0700)
commit6e43a0623ecbebbd4898cd79fc33272b420ef35a
tree277355d3b16eede66a8069e8cd110b0e2916b168
parentf751ee94c4dbd490eaa95bec83da9a383fd9acc4
revision: expose check for paths maybe changed in Bloom filter

check_maybe_different_in_bloom_filter() looks up a commit's changed-path
Bloom filter and consults it to see whether the commit might have
modified any of the paths in the pathspec that `revs` was set up with.
In a follow-up commit we want to reuse this logic from another builtin.

That caller, however, has already looked up the commit's Bloom filter
for its own purposes, so having the function look it up again would mean
a redundant lookup.

Extract the filter-consulting part into a new public function,
revs_maybe_changed_in_bloom(). This function takes an already looked-up
`struct bloom_filter` instead of a commit.
The existing check_maybe_different_in_bloom_filter() becomes a thin
wrapper that looks up the filter and delegates.

Expose the new function via revision.h so other builtins can reuse the
exact same filtering that `git log <pathspec>` performs.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
revision.h