diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-09-29 23:01:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-29 23:01:20 +0200 |
commit | 288ed98bf768f4df9b569d51a52c233a1402c0f5 (patch) | |
tree | 671cd2dddfb6b1adc8a9d1c7b516f4f5622bd092 /commit-graph.h | |
parent | Merge branch 'bc/faq-misc' (diff) | |
parent | commit-graph: introduce 'commitGraph.maxNewFilters' (diff) | |
download | git-288ed98bf768f4df9b569d51a52c233a1402c0f5.tar.xz git-288ed98bf768f4df9b569d51a52c233a1402c0f5.zip |
Merge branch 'tb/bloom-improvements'
"git commit-graph write" learned to limit the number of bloom
filters that are computed from scratch with the --max-new-filters
option.
* tb/bloom-improvements:
commit-graph: introduce 'commitGraph.maxNewFilters'
builtin/commit-graph.c: introduce '--max-new-filters=<n>'
commit-graph: rename 'split_commit_graph_opts'
bloom: encode out-of-bounds filters as non-empty
bloom/diff: properly short-circuit on max_changes
bloom: use provided 'struct bloom_filter_settings'
bloom: split 'get_bloom_filter()' in two
commit-graph.c: store maximum changed paths
commit-graph: respect 'commitGraph.readChangedPaths'
t/helper/test-read-graph.c: prepare repo settings
commit-graph: pass a 'struct repository *' in more places
t4216: use an '&&'-chain
commit-graph: introduce 'get_bloom_filter_settings()'
Diffstat (limited to 'commit-graph.h')
-rw-r--r-- | commit-graph.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/commit-graph.h b/commit-graph.h index 765221cdcc..f8e92500c6 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -76,11 +76,13 @@ struct commit_graph { struct bloom_filter_settings *bloom_filter_settings; }; -struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st, +struct commit_graph *load_commit_graph_one_fd_st(struct repository *r, + int fd, struct stat *st, struct object_directory *odb); struct commit_graph *read_commit_graph_one(struct repository *r, struct object_directory *odb); -struct commit_graph *parse_commit_graph(void *graph_map, size_t graph_size); +struct commit_graph *parse_commit_graph(struct repository *r, + void *graph_map, size_t graph_size); /* * Return 1 if and only if the repository has a commit-graph @@ -88,6 +90,8 @@ struct commit_graph *parse_commit_graph(void *graph_map, size_t graph_size); */ int generation_numbers_enabled(struct repository *r); +struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r); + enum commit_graph_write_flags { COMMIT_GRAPH_WRITE_APPEND = (1 << 0), COMMIT_GRAPH_WRITE_PROGRESS = (1 << 1), @@ -102,11 +106,12 @@ enum commit_graph_split_flags { COMMIT_GRAPH_SPLIT_REPLACE = 2 }; -struct split_commit_graph_opts { +struct commit_graph_opts { int size_multiple; int max_commits; timestamp_t expire_time; - enum commit_graph_split_flags flags; + enum commit_graph_split_flags split_flags; + int max_new_filters; }; /* @@ -117,12 +122,12 @@ struct split_commit_graph_opts { */ int write_commit_graph_reachable(struct object_directory *odb, enum commit_graph_write_flags flags, - const struct split_commit_graph_opts *split_opts); + const struct commit_graph_opts *opts); int write_commit_graph(struct object_directory *odb, struct string_list *pack_indexes, struct oidset *commits, enum commit_graph_write_flags flags, - const struct split_commit_graph_opts *split_opts); + const struct commit_graph_opts *opts); #define COMMIT_GRAPH_VERIFY_SHALLOW (1 << 0) |