[PATCH 2/3] commit: write commit-graph with bloom filters
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 11, 2020, 01:03 UTC
- Message-ID
- <bb5ce39d0283f14095d87dd0645e641ae799f16c.1586566981.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.609.git.1586566981.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> --- builtin/commit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c index d3e7781e658..d2fdfdc4363 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1701,7 +1701,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix) "not exceeded, and then \"git restore --staged :/\" to recover.")); if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0) && - write_commit_graph_reachable(the_repository->objects->odb, 0, NULL)) + write_commit_graph_reachable(the_repository->objects->odb, + git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0) ? COMMIT_GRAPH_WRITE_BLOOM_FILTERS : 0, + NULL)) return 1; repo_rerere(the_repository, 0);
-- gitgitgadget