Merge branch 'ma/commit-graph-docs'

Doc update.

* ma/commit-graph-docs:
  Doc: refer to the "commit-graph file" with dash
  git-commit-graph.txt: refer to "*commit*-graph file"
  git-commit-graph.txt: typeset more in monospace
  git-commit-graph.txt: fix bullet lists
This commit is contained in:
Junio C Hamano 2018-10-16 16:16:05 +09:00
commit 9a40ffd751
2 changed files with 20 additions and 19 deletions

View File

@ -3,7 +3,7 @@ git-commit-graph(1)
NAME NAME
---- ----
git-commit-graph - Write and verify Git commit graph files git-commit-graph - Write and verify Git commit-graph files
SYNOPSIS SYNOPSIS
@ -17,24 +17,24 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
----------- -----------
Manage the serialized commit graph file. Manage the serialized commit-graph file.
OPTIONS OPTIONS
------- -------
--object-dir:: --object-dir::
Use given directory for the location of packfiles and commit graph Use given directory for the location of packfiles and commit-graph
file. This parameter exists to specify the location of an alternate file. This parameter exists to specify the location of an alternate
that only has the objects directory, not a full .git directory. The that only has the objects directory, not a full `.git` directory. The
commit graph file is expected to be at <dir>/info/commit-graph and commit-graph file is expected to be at `<dir>/info/commit-graph` and
the packfiles are expected to be in <dir>/pack. the packfiles are expected to be in `<dir>/pack`.
COMMANDS COMMANDS
-------- --------
'write':: 'write'::
Write a commit graph file based on the commits found in packfiles. Write a commit-graph file based on the commits found in packfiles.
+ +
With the `--stdin-packs` option, generate the new commit graph by With the `--stdin-packs` option, generate the new commit graph by
walking objects only in the specified pack-indexes. (Cannot be combined walking objects only in the specified pack-indexes. (Cannot be combined
@ -54,8 +54,8 @@ existing commit-graph file.
'read':: 'read'::
Read a graph file given by the commit-graph file and output basic Read the commit-graph file and output basic details about it.
details about the graph file. Used for debugging purposes. Used for debugging purposes.
'verify':: 'verify'::
@ -66,27 +66,28 @@ database. Used to check for corrupted data.
EXAMPLES EXAMPLES
-------- --------
* Write a commit graph file for the packed commits in your local .git folder. * Write a commit-graph file for the packed commits in your local `.git`
directory.
+ +
------------------------------------------------ ------------------------------------------------
$ git commit-graph write $ git commit-graph write
------------------------------------------------ ------------------------------------------------
* Write a graph file, extending the current graph file using commits * Write a commit-graph file, extending the current commit-graph file
* in <pack-index>. using commits in `<pack-index>`.
+ +
------------------------------------------------ ------------------------------------------------
$ echo <pack-index> | git commit-graph write --stdin-packs $ echo <pack-index> | git commit-graph write --stdin-packs
------------------------------------------------ ------------------------------------------------
* Write a graph file containing all reachable commits. * Write a commit-graph file containing all reachable commits.
+ +
------------------------------------------------ ------------------------------------------------
$ git show-ref -s | git commit-graph write --stdin-commits $ git show-ref -s | git commit-graph write --stdin-commits
------------------------------------------------ ------------------------------------------------
* Write a graph file containing all commits in the current * Write a commit-graph file containing all commits in the current
* commit-graph file along with those reachable from HEAD. commit-graph file along with those reachable from `HEAD`.
+ +
------------------------------------------------ ------------------------------------------------
$ git rev-parse HEAD | git commit-graph write --stdin-commits --append $ git rev-parse HEAD | git commit-graph write --stdin-commits --append

View File

@ -15,13 +15,13 @@ There are two main costs here:
1. Decompressing and parsing commits. 1. Decompressing and parsing commits.
2. Walking the entire graph to satisfy topological order constraints. 2. Walking the entire graph to satisfy topological order constraints.
The commit graph file is a supplemental data structure that accelerates The commit-graph file is a supplemental data structure that accelerates
commit graph walks. If a user downgrades or disables the 'core.commitGraph' commit graph walks. If a user downgrades or disables the 'core.commitGraph'
config setting, then the existing ODB is sufficient. The file is stored config setting, then the existing ODB is sufficient. The file is stored
as "commit-graph" either in the .git/objects/info directory or in the info as "commit-graph" either in the .git/objects/info directory or in the info
directory of an alternate. directory of an alternate.
The commit graph file stores the commit graph structure along with some The commit-graph file stores the commit graph structure along with some
extra metadata to speed up graph walks. By listing commit OIDs in lexi- extra metadata to speed up graph walks. By listing commit OIDs in lexi-
cographic order, we can identify an integer position for each commit and cographic order, we can identify an integer position for each commit and
refer to the parents of a commit using those integer positions. We use refer to the parents of a commit using those integer positions. We use
@ -103,7 +103,7 @@ that of a parent.
Design Details Design Details
-------------- --------------
- The commit graph file is stored in a file named 'commit-graph' in the - The commit-graph file is stored in a file named 'commit-graph' in the
.git/objects/info directory. This could be stored in the info directory .git/objects/info directory. This could be stored in the info directory
of an alternate. of an alternate.
@ -139,7 +139,7 @@ Future Work
- 'log --topo-order' - 'log --topo-order'
- 'tag --merged' - 'tag --merged'
- A server could provide a commit graph file as part of the network protocol - A server could provide a commit-graph file as part of the network protocol
to avoid extra calculations by clients. This feature is only of benefit if to avoid extra calculations by clients. This feature is only of benefit if
the user is willing to trust the file, because verifying the file is correct the user is willing to trust the file, because verifying the file is correct
is as hard as computing it from scratch. is as hard as computing it from scratch.