diff options
author | Taylor Blau <me@ttaylorr.com> | 2020-04-14 06:04:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-15 18:20:27 +0200 |
commit | fdbde82fe523374b3c5d1f0f01f3c43dcaca9465 (patch) | |
tree | 4218bdad84063c7b7ce921c53c0c6f57343e3aaa /t/t5324-split-commit-graph.sh | |
parent | builtin/commit-graph.c: support for '--split[=<strategy>]' (diff) | |
download | git-fdbde82fe523374b3c5d1f0f01f3c43dcaca9465.tar.xz git-fdbde82fe523374b3c5d1f0f01f3c43dcaca9465.zip |
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 't/t5324-split-commit-graph.sh')
-rwxr-xr-x | t/t5324-split-commit-graph.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index c24823431f..29de47e834 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -344,4 +344,15 @@ test_expect_success 'split across alternate where alternate is not split' ' test_cmp commit-graph .git/objects/info/commit-graph ' +test_expect_success '--split=no-merge always writes an incremental' ' + test_when_finished rm -rf a b && + rm -rf $graphdir $infodir/commit-graph && + git reset --hard commits/2 && + git rev-list HEAD~1 >a && + git rev-list HEAD >b && + git commit-graph write --split --stdin-commits <a && + git commit-graph write --split=no-merge --stdin-commits <b && + test_line_count = 2 $graphdir/commit-graph-chain +' + test_done |