]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/path-filter-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Jul 2024 21:53:09 +0000 (14:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Jul 2024 21:53:10 +0000 (14:53 -0700)
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()`

1  2 
bloom.c
commit-graph.c
object.h
oss-fuzz/fuzz-commit-graph.c
repo-settings.c
repository.h
revision.c
t/helper/test-bloom.c
t/helper/test-read-graph.c

diff --cc bloom.c
index bbf146fc30c7e8ddfa56074a5af2770129e2d57a,d080a1b6162628c76166e188eeeb280a1c2a2d3a..c915f8b1ba8c4a112ab8d93607aeca5de437cd11
+++ 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 93c075552a4c5d7308007362006cd44d16897e15,0de0f38b53db55abfb7d2f671f8e114c8182043c..79b0e72cc42cad5e5feeecebd54fd9f9b6cff14e
@@@ -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 object.h
Simple merge
index 951c9c082f9f65e4f4c0fbd049364829f47fea3b,325c0b991ab1b30477d5ee8a6f03bb606c3d2385..fbb77fec197721dca3cbe28c7acc4f52698a549e
@@@ -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);
diff --cc repo-settings.c
Simple merge
diff --cc repository.h
Simple merge
diff --cc revision.c
Simple merge
Simple merge
Simple merge