summaryrefslogtreecommitdiff
path: root/builtin/commit-graph.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2020-04-14 04:04:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-15 16:20:27 (GMT)
commitfdbde82fe523374b3c5d1f0f01f3c43dcaca9465 (patch)
tree4218bdad84063c7b7ce921c53c0c6f57343e3aaa /builtin/commit-graph.c
parent4f027355f6b6b5b2ba69e23ff50cb7313d13dd70 (diff)
downloadgit-fdbde82fe523374b3c5d1f0f01f3c43dcaca9465.zip
git-fdbde82fe523374b3c5d1f0f01f3c43dcaca9465.tar.gz
git-fdbde82fe523374b3c5d1f0f01f3c43dcaca9465.tar.bz2
builtin/commit-graph.c: introduce split strategy 'no-merge'
In the previous commit, we laid the groundwork for supporting different splitting strategies. In this commit, we introduce the first splitting strategy: 'no-merge'. Passing '--split=no-merge' is useful for callers which wish to write a new incremental commit-graph, but do not want to spend effort condensing the incremental chain [1]. Previously, this was possible by passing '--size-multiple=0', but this no longer the case following 63020f175f (commit-graph: prefer default size_mult when given zero, 2020-01-02). When '--split=no-merge' is given, the commit-graph machinery will never condense an existing chain, and it will always write a new incremental. [1]: This might occur when, for example, a server administrator running some program after each push may want to ensure that each job runs proportional in time to the size of the push, and does not "jump" when the commit-graph machinery decides to trigger a merge. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
-rw-r--r--builtin/commit-graph.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 345fd97..9234b95 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -118,11 +118,16 @@ static struct split_commit_graph_opts split_opts;
static int write_option_parse_split(const struct option *opt, const char *arg,
int unset)
{
+ enum commit_graph_split_flags *flags = opt->value;
+
opts.split = 1;
if (!arg)
return 0;
- die(_("unrecognized --split argument, %s"), arg);
+ if (!strcmp(arg, "no-merge"))
+ *flags = COMMIT_GRAPH_SPLIT_MERGE_PROHIBITED;
+ else
+ die(_("unrecognized --split argument, %s"), arg);
return 0;
}