git-commit-vandalism/Documentation/technical
Derrick Stolee 1771be90c8 commit-graph: merge commit-graph chains
When searching for a commit in a commit-graph chain of G graphs with N
commits, the search takes O(G log N) time. If we always add a new tip
graph with every write, the linear G term will start to dominate and
slow the lookup process.

To keep lookups fast, but also keep most incremental writes fast, create
a strategy for merging levels of the commit-graph chain. The strategy is
detailed in the commit-graph design document, but is summarized by these
two conditions:

  1. If the number of commits we are adding is more than half the number
     of commits in the graph below, then merge with that graph.

  2. If we are writing more than 64,000 commits into a single graph,
     then merge with all lower graphs.

The numeric values in the conditions above are currently constant, but
can become config options in a future update.

As we merge levels of the commit-graph chain, check that the commits
still exist in the repository. A garbage-collection operation may have
removed those commits from the object store and we do not want to
persist them in the commit-graph chain. This is a non-issue if the
'git gc' process wrote a new, single-level commit-graph file.

After we merge levels, the old graph-{hash}.graph files are no longer
referenced by the commit-graph-chain file. We will expire these files in
a future change.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-06-19 20:46:26 -07:00
..
.gitignore Start preparing the API documents. 2007-12-14 22:29:38 -08:00
api-allocation-growing.txt add macro REALLOC_ARRAY 2014-09-18 09:13:38 -07:00
api-argv-array.txt api-argv-array.txt: remove broken link to string-list API 2017-10-06 21:16:03 +09:00
api-config.txt doc: fix config API documentation about config_with_options 2018-05-11 10:26:33 +09:00
api-credentials.txt Documentation: fix linkgit references 2016-05-09 15:44:14 -07:00
api-diff.txt diff.c: remove implicit dependency on the_index 2018-09-21 09:48:10 -07:00
api-directory-listing.txt Documentation: spelling and grammar fixes 2018-06-22 14:26:23 -07:00
api-error-handling.txt api-error-handling doc: typofix 2015-03-28 09:24:55 -07:00
api-gitattributes.txt Documentation: spelling and grammar fixes 2018-06-22 14:26:23 -07:00
api-grep.txt Start preparing the API documents. 2007-12-14 22:29:38 -08:00
api-history-graph.txt docs: graph: remove unnecessary `graph_update()' call 2018-10-07 10:10:49 +09:00
api-index-skel.txt Documentation: avoid poor-man's small caps GIT 2013-02-01 13:53:25 -08:00
api-index.sh Start preparing the API documents. 2007-12-14 22:29:38 -08:00
api-merge.txt docs: fix cross-directory linkgit references 2012-06-08 08:31:52 -07:00
api-object-access.txt sha1_file.c: rename to use dash in file name 2018-04-11 18:11:00 +09:00
api-oid-array.txt sha1-array: provide oid_array_filter 2018-12-05 11:42:31 +09:00
api-parse-options.txt parse-options: drop OPT_DATE() 2018-11-06 12:56:14 +09:00
api-quote.txt Start preparing the API documents. 2007-12-14 22:29:38 -08:00
api-ref-iteration.txt refs: remove dead for_each_*_submodule() 2017-08-24 14:56:28 -07:00
api-remote.txt http: allow selection of proxy authentication method 2016-01-26 10:53:09 -08:00
api-revision-walking.txt revision.c: remove implicit dependency on the_index 2018-09-21 09:51:19 -07:00
api-run-command.txt run-command: factor out child_process_clear() 2015-11-02 15:01:00 -08:00
api-setup.txt pathspec: remove the deprecated get_pathspec function 2017-01-08 18:04:17 -08:00
api-sigchain.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
api-submodule-config.txt Merge branch 'sb/submodule-move-nested' 2018-05-08 15:59:17 +09:00
api-trace.txt Merge branch 'ep/trace-doc-sample-fix' 2016-04-13 14:12:39 -07:00
api-tree-walking.txt tree-walk: convert fill_tree_descriptor() to object_id 2017-08-14 12:38:54 -07:00
api-xdiff-interface.txt Start preparing the API documents. 2007-12-14 22:29:38 -08:00
bitmap-format.txt pack-bitmap: implement optional name_hash cache 2013-12-30 12:19:23 -08:00
commit-graph-format.txt commit-graph: add base graphs chunk 2019-06-19 20:46:26 -07:00
commit-graph.txt commit-graph: merge commit-graph chains 2019-06-19 20:46:26 -07:00
directory-rename-detection.txt git-rebase.txt: document behavioral differences between modes 2018-06-27 11:23:22 -07:00
hash-function-transition.txt doc hash-function-transition: pick SHA-256 as NewHash 2018-08-07 07:40:43 -07:00
http-protocol.txt doc: fix want-capability separator 2018-07-30 11:25:20 -07:00
index-format.txt ieot: add Index Entry Offset Table (IEOT) extension 2018-10-11 15:32:48 +09:00
long-running-process-protocol.txt Docs: split out long-running subprocess handshake 2018-01-25 11:24:32 -08:00
multi-pack-index.txt multi-pack-index: add design document 2018-07-12 13:55:02 -07:00
pack-format.txt midx: write object offsets 2018-07-20 11:27:28 -07:00
pack-heuristics.txt pack-heuristics.txt: mark up the file header properly 2014-01-13 11:18:34 -08:00
pack-protocol.txt pack-protocol.txt: accept error packets in any context 2019-01-02 13:05:30 -08:00
partial-clone.txt partial-clone: add missing 'is' in doc 2019-01-14 11:06:47 -08:00
protocol-capabilities.txt upload-pack: add object filtering for partial clone 2017-12-08 09:58:51 -08:00
protocol-common.txt Merge branch 'ls/packet-line-protocol-doc-fix' 2016-08-31 10:03:51 -07:00
protocol-v2.txt Merge branch 'jt/fetch-v2-sideband' 2019-02-05 14:26:11 -08:00
racy-git.txt Makefile / racy-git.txt: clarify USE_NSEC prerequisites 2015-07-01 14:54:42 -07:00
repository-version.txt doc: move extensions.worktreeConfig to the right place 2018-11-16 14:10:31 +09:00
rerere.txt rerere: mention caveat about unmatched conflict markers 2018-08-29 08:54:11 -07:00
send-pack-pipeline.txt Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txt 2012-10-16 16:09:09 -07:00
shallow.txt technical/shallow: describe why shallow cannot use replace refs 2018-04-30 11:12:31 +09:00
signature-format.txt Documentation/technical: signed merge tag format 2016-06-17 12:10:48 -07:00
trivial-merge.txt treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00