diff options
author | Taylor Blau <me@ttaylorr.com> | 2020-04-14 04:04:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-15 16:20:26 (GMT) |
commit | 4f027355f6b6b5b2ba69e23ff50cb7313d13dd70 (patch) | |
tree | e6719d8fa7afd9ff7c730aa895be861ab5332e93 /commit-graph.h | |
parent | 2fa05f31bd95eed34d6e8848b6b1e6265674f50a (diff) | |
download | git-4f027355f6b6b5b2ba69e23ff50cb7313d13dd70.zip git-4f027355f6b6b5b2ba69e23ff50cb7313d13dd70.tar.gz git-4f027355f6b6b5b2ba69e23ff50cb7313d13dd70.tar.bz2 |
builtin/commit-graph.c: support for '--split[=<strategy>]'
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[=<strategy>]'), 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 <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
-rw-r--r-- | commit-graph.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/commit-graph.h b/commit-graph.h index e87a6f6..e799008 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; }; /* |