[PATCH v2 2/4] commit: write commit-graph with Bloom filters
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 13, 2020, 14:45 UTC
- Message-ID
- <7e8f1aed1138ab2a52a8957ac95895ac9effd933.1586789126.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.609.v2.git.1586789126.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
The GIT_TEST_COMMIT_GRAPH environment variable updates the commit- graph file whenever "git commit" is run, ensuring that we always have an updated commit-graph throughout the test suite. The GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS environment variable was introduced to write the changed-path Bloom filters whenever "git commit-graph write" is run. However, the GIT_TEST_COMMIT_GRAPH trick doesn't launch a separate process and instead writes it directly.
Update the "git commit" builtin to write changed-path Bloom filters when both GIT_TEST_COMMIT_GRAPH and GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS are enabled.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- commit-graph.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/commit-graph.c b/commit-graph.c index 77668629e27..3e8f36ce5c8 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1968,6 +1968,8 @@ int write_commit_graph(struct object_directory *odb, ctx->check_oids = flags & COMMIT_GRAPH_WRITE_CHECK_OIDS ? 1 : 0; ctx->split_opts = split_opts; ctx->changed_paths = flags & COMMIT_GRAPH_WRITE_BLOOM_FILTERS ? 1 : 0; + if (git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0)) + ctx->changed_paths = 1; ctx->total_bloom_filter_data_size = 0; if (ctx->split) {
-- gitgitgadget