]> git.ipfire.org Git - thirdparty/git.git/commit - commit-graph.h
builtin/commit-graph.c: support for '--split[=<strategy>]'
authorTaylor Blau <me@ttaylorr.com>
Tue, 14 Apr 2020 04:04:08 +0000 (22:04 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Apr 2020 16:20:26 +0000 (09:20 -0700)
commit4f027355f6b6b5b2ba69e23ff50cb7313d13dd70
treee6719d8fa7afd9ff7c730aa895be861ab5332e93
parent2fa05f31bd95eed34d6e8848b6b1e6265674f50a
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>
Documentation/git-commit-graph.txt
builtin/commit-graph.c
commit-graph.h