From: Junio C Hamano Date: Mon, 8 Jul 2024 21:53:09 +0000 (-0700) Subject: Merge branch 'tb/path-filter-fix' X-Git-Tag: v2.46.0-rc0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecf7fc600a5218c9ee3863ee70d5a6e312164f30;p=thirdparty%2Fgit.git 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()` --- ecf7fc600a5218c9ee3863ee70d5a6e312164f30 diff --cc bloom.c index bbf146fc30,d080a1b616..c915f8b1ba --- a/bloom.c +++ b/bloom.c @@@ -6,7 -6,9 +6,10 @@@ #include "commit-graph.h" #include "commit.h" #include "commit-slab.h" + #include "tree.h" + #include "tree-walk.h" + #include "config.h" +#include "repository.h" define_commit_slab(bloom_filter_slab, struct bloom_filter); diff --cc commit-graph.c index 93c075552a,0de0f38b53..79b0e72cc4 --- a/commit-graph.c +++ b/commit-graph.c @@@ -810,10 -827,8 +831,11 @@@ struct bloom_filter_settings *get_bloom void close_commit_graph(struct raw_object_store *o) { + if (!o->commit_graph) + return; + clear_commit_graph_data_slab(&commit_graph_data_slab); + deinit_bloom_filters(); free_commit_graph(o->commit_graph); o->commit_graph = NULL; } diff --cc oss-fuzz/fuzz-commit-graph.c index 951c9c082f,325c0b991a..fbb77fec19 --- a/oss-fuzz/fuzz-commit-graph.c +++ b/oss-fuzz/fuzz-commit-graph.c @@@ -21,9 -18,8 +21,9 @@@ int LLVMFuzzerTestOneInput(const uint8_ * touching the disk to keep the individual fuzz-test cases as fast as * possible. */ + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); the_repository->settings.commit_graph_generation_version = 2; - the_repository->settings.commit_graph_read_changed_paths = 1; + the_repository->settings.commit_graph_changed_paths_version = 1; g = parse_commit_graph(&the_repository->settings, (void *)data, size); repo_clear(the_repository); free_commit_graph(g);