From 4f027355f6b6b5b2ba69e23ff50cb7313d13dd70 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Mon, 13 Apr 2020 22:04:08 -0600 Subject: builtin/commit-graph.c: support for '--split[=]' With '--split', the commit-graph machinery writes new commits in another incremental commit-graph which is part of the existing chain, and optionally decides to condense the chain into a single commit-graph. This is done to ensure that the asymptotic behavior of looking up a commit in an incremental chain is not dominated by the number of incrementals in that chain. It can be controlled by the '--max-commits' and '--size-multiple' options. In the next two commits, we will introduce additional splitting strategies that can exert additional control over: - when a split commit-graph is and isn't written, and - when the existing commit-graph chain is discarded completely and replaced with another graph To prepare for this, make '--split' take an optional strategy (as in '--split[=]'), and add a new enum to describe which strategy is being used. For now, no strategies are given, and the only enumerated value is 'COMMIT_GRAPH_SPLIT_UNSPECIFIED', indicating the absence of a strategy. Signed-off-by: Taylor Blau Signed-off-by: Junio C Hamano --- commit-graph.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'commit-graph.h') diff --git a/commit-graph.h b/commit-graph.h index e87a6f6360..e799008ff4 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -82,10 +82,15 @@ enum commit_graph_write_flags { COMMIT_GRAPH_WRITE_CHECK_OIDS = (1 << 3) }; +enum commit_graph_split_flags { + COMMIT_GRAPH_SPLIT_UNSPECIFIED = 0 +}; + struct split_commit_graph_opts { int size_multiple; int max_commits; timestamp_t expire_time; + enum commit_graph_split_flags flags; }; /* -- cgit 1.2.3-korg