summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-05-01 13:39:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-05-01 13:39:54 -0700
commit6d56d4c7dcd667d28aec28498591723c6febea1c (patch)
tree1d583dce7f1063b570c4d18f223c1ec7b9473836 /revision.c
parentMerge branch 'gs/commit-graph-path-filter' (diff)
parenttest-bloom: check that we have expected arguments (diff)
downloadtgif-6d56d4c7dcd667d28aec28498591723c6febea1c.tar.xz
Merge branch 'ds/blame-on-bloom'
"git blame" learns to take advantage of the "changed-paths" Bloom filter stored in the commit-graph file. * ds/blame-on-bloom: test-bloom: check that we have expected arguments test-bloom: fix some whitespace issues blame: drop unused parameter from maybe_changed_path blame: use changed-path Bloom filters tests: write commit-graph with Bloom filters revision: complicated pathspecs disable filters
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 43857823bd..60cca8c0b9 100644
--- a/revision.c
+++ b/revision.c
@@ -650,6 +650,20 @@ static void trace2_bloom_filter_statistics_atexit(void)
jw_release(&jw);
}
+static int forbid_bloom_filters(struct pathspec *spec)
+{
+ if (spec->has_wildcard)
+ return 1;
+ if (spec->nr > 1)
+ return 1;
+ if (spec->magic & ~PATHSPEC_LITERAL)
+ return 1;
+ if (spec->nr && (spec->items[0].magic & ~PATHSPEC_LITERAL))
+ return 1;
+
+ return 0;
+}
+
static void prepare_to_use_bloom_filter(struct rev_info *revs)
{
struct pathspec_item *pi;
@@ -659,7 +673,10 @@ static void prepare_to_use_bloom_filter(struct rev_info *revs)
int len;
if (!revs->commits)
- return;
+ return;
+
+ if (forbid_bloom_filters(&revs->prune_data))
+ return;
repo_parse_commit(revs->repo, revs->commits->item);