aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-bloom.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-07-08 14:53:09 -0700
committerJunio C Hamano <gitster@pobox.com>2024-07-08 14:53:10 -0700
commitecf7fc600a5218c9ee3863ee70d5a6e312164f30 (patch)
treebcea9bd3948c998759ea848ee55592ac1e1f8a16 /t/helper/test-bloom.c
parent6f75d230a1661266c5582d174c7bb6a4d60842dc (diff)
parent9c8a9ec787149dc4f4b278d9bd8ad94c96691a5f (diff)
downloadgit-ecf7fc600a5218c9ee3863ee70d5a6e312164f30.tar.gz
Merge branch 'tb/path-filter-fix'
The Bloom filter used for path limited history traversal was broken on systems whose "char" is unsigned; update the implementation and bump the format version to 2. * tb/path-filter-fix: bloom: introduce `deinit_bloom_filters()` commit-graph: reuse existing Bloom filters where possible object.h: fix mis-aligned flag bits table commit-graph: new Bloom filter version that fixes murmur3 commit-graph: unconditionally load Bloom filters bloom: prepare to discard incompatible Bloom filters bloom: annotate filters with hash version repo-settings: introduce commitgraph.changedPathsVersion t4216: test changed path filters with high bit paths t/helper/test-read-graph: implement `bloom-filters` mode bloom.h: make `load_bloom_filter_from_graph()` public t/helper/test-read-graph.c: extract `dump_graph_info()` gitformat-commit-graph: describe version 2 of BDAT commit-graph: ensure Bloom filters are read with consistent settings revision.c: consult Bloom filters for root commits t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()`
Diffstat (limited to 't/helper/test-bloom.c')
-rw-r--r--t/helper/test-bloom.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/helper/test-bloom.c b/t/helper/test-bloom.c
index f7f9b62002..97541daf71 100644
--- a/t/helper/test-bloom.c
+++ b/t/helper/test-bloom.c
@@ -51,6 +51,7 @@ static void get_bloom_filter_for_commit(const struct object_id *commit_oid)
static const char *bloom_usage = "\n"
" test-tool bloom get_murmur3 <string>\n"
+" test-tool bloom get_murmur3_seven_highbit\n"
" test-tool bloom generate_filter <string> [<string>...]\n"
" test-tool bloom get_filter_for_commit <commit-hex>\n";
@@ -65,7 +66,13 @@ int cmd__bloom(int argc, const char **argv)
uint32_t hashed;
if (argc < 3)
usage(bloom_usage);
- hashed = murmur3_seeded(0, argv[2], strlen(argv[2]));
+ hashed = murmur3_seeded_v2(0, argv[2], strlen(argv[2]));
+ printf("Murmur3 Hash with seed=0:0x%08x\n", hashed);
+ }
+
+ if (!strcmp(argv[1], "get_murmur3_seven_highbit")) {
+ uint32_t hashed;
+ hashed = murmur3_seeded_v2(0, "\x99\xaa\xbb\xcc\xdd\xee\xff", 7);
printf("Murmur3 Hash with seed=0:0x%08x\n", hashed);
}