1
0
mirror of https://github.com/git/git.git synced 2024-10-19 18:48:25 +02:00
git/t/helper
Taylor Blau 312cff5207 bloom: split 'get_bloom_filter()' in two
'get_bloom_filter' takes a flag to control whether it will compute a
Bloom filter if the requested one is missing. In the next patch, we'll
add yet another parameter to this method, which would force all but one
caller to specify an extra 'NULL' parameter at the end.

Instead of doing this, split 'get_bloom_filter' into two functions:
'get_bloom_filter' and 'get_or_compute_bloom_filter'. The former only
looks up a Bloom filter (and does not compute one if it's missing,
thus dropping the 'compute_if_not_present' flag). The latter does
compute missing Bloom filters, with an additional parameter to store
whether or not it needed to do so.

This simplifies many call-sites, since the majority of existing callers
to 'get_bloom_filter' do not want missing Bloom filters to be computed
(so they can drop the parameter entirely and use the simpler version of
the function).

While we're at it, instrument the new 'get_or_compute_bloom_filter()'
with counters in the 'write_commit_graph_context' struct which store
the number of filters that we did and didn't compute, as well as filters
that were truncated.

It would be nice to drop the 'compute_if_not_present' flag entirely,
since all remaining callers of 'get_or_compute_bloom_filter' pass it as
'1', but this will change in a future patch and hence cannot be removed.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-09-17 09:31:25 -07:00
..
.gitignore
test-advise.c
test-bloom.c bloom: split 'get_bloom_filter()' in two 2020-09-17 09:31:25 -07:00
test-chmtime.c
test-config.c
test-ctype.c
test-date.c
test-delta.c
test-dir-iterator.c
test-drop-caches.c
test-dump-cache-tree.c
test-dump-fsmonitor.c
test-dump-split-index.c
test-dump-untracked-cache.c
test-example-decorate.c
test-fake-ssh.c
test-genrandom.c
test-genzeros.c
test-hash-speed.c
test-hash.c
test-hashmap.c
test-index-version.c
test-json-writer.c
test-lazy-init-name-hash.c
test-line-buffer.c
test-match-trees.c
test-mergesort.c
test-mktemp.c
test-oid-array.c t/helper: initialize the repository for test-sha1-array 2020-06-19 14:04:08 -07:00
test-oidmap.c
test-online-cpus.c
test-parse-options.c
test-parse-pathspec-file.c
test-path-utils.c
test-pkt-line.c
test-prio-queue.c
test-progress.c
test-reach.c Merge branch 'cb/is-descendant-of' 2020-07-06 22:09:16 -07:00
test-read-cache.c
test-read-graph.c t/helper/test-read-graph.c: prepare repo settings 2020-09-09 12:51:48 -07:00
test-read-midx.c
test-ref-store.c worktree: drop get_worktrees() unused 'flags' argument 2020-06-22 10:31:15 -07:00
test-regex.c
test-repository.c
test-revision-walking.c
test-run-command.c
test-scrap-cache-tree.c
test-serve-v2.c
test-sha1.c
test-sha1.sh
test-sha256.c
test-sigchain.c
test-strcmp-offset.c
test-string-list.c
test-submodule-config.c
test-submodule-nested-repo-config.c
test-subprocess.c
test-svn-fe.c
test-tool.c
test-tool.h
test-trace2.c
test-urlmatch-normalization.c
test-wildmatch.c
test-windows-named-pipe.c
test-write-cache.c
test-xml-encode.c