Skip to content

Commit 8cbace9

Browse files
avargitster
authored andcommitted
docs: move commit-graph format docs to man section 5
Continue the move of existing Documentation/technical/* protocol and file-format documentation into our main documentation space. By moving the documentation for the commit-graph format into man section 5 and the new "developerinterfaces" category. This change is split from subsequent commits due to the relatively large amount of ASCIIDOC formatting changes that are required. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 844739b commit 8cbace9

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

Documentation/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ MAN1_TXT += gitweb.txt
2525
# man5 / man7 guides (note: new guides should also be added to command-list.txt)
2626
MAN5_TXT += gitattributes.txt
2727
MAN5_TXT += gitformat-bundle.txt
28+
MAN5_TXT += gitformat-commit-graph.txt
2829
MAN5_TXT += githooks.txt
2930
MAN5_TXT += gitignore.txt
3031
MAN5_TXT += gitmailmap.txt

Documentation/git-commit-graph.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ $ git rev-parse HEAD | git commit-graph write --stdin-commits --append
143143
------------------------------------------------
144144

145145

146+
FILE FORMAT
147+
-----------
148+
149+
see linkgit:gitformat-commit-graph[5].
150+
146151
GIT
147152
---
148153
Part of the linkgit:git[1] suite

Documentation/technical/commit-graph-format.txt renamed to Documentation/gitformat-commit-graph.txt

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
Git commit graph format
2-
=======================
1+
gitformat-commit-graph(5)
2+
=========================
3+
4+
NAME
5+
----
6+
gitformat-commit-graph - Git commit graph format
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
$GIT_DIR/objects/info/commit-graph
12+
$GIT_DIR/objects/info/commit-graphs/*
13+
14+
DESCRIPTION
15+
-----------
316

417
The Git commit graph stores a list of commit OIDs and some associated
518
metadata, including:
@@ -30,7 +43,7 @@ and hash type.
3043

3144
All multi-byte numbers are in network byte order.
3245

33-
HEADER:
46+
=== HEADER:
3447

3548
4-byte signature:
3649
The signature is: {'C', 'G', 'P', 'H'}
@@ -52,7 +65,7 @@ HEADER:
5265
We infer the length (H*B) of the Base Graphs chunk
5366
from this value.
5467

55-
CHUNK LOOKUP:
68+
=== CHUNK LOOKUP:
5669

5770
(C + 1) * 12 bytes listing the table of contents for the chunks:
5871
First 4 bytes describe the chunk id. Value 0 is a terminating label.
@@ -68,17 +81,17 @@ CHUNK LOOKUP:
6881
these chunks may be given in any order. Chunks are required unless
6982
otherwise specified.
7083

71-
CHUNK DATA:
84+
=== CHUNK DATA:
7285

73-
OID Fanout (ID: {'O', 'I', 'D', 'F'}) (256 * 4 bytes)
86+
==== OID Fanout (ID: {'O', 'I', 'D', 'F'}) (256 * 4 bytes)
7487
The ith entry, F[i], stores the number of OIDs with first
7588
byte at most i. Thus F[255] stores the total
7689
number of commits (N).
7790

78-
OID Lookup (ID: {'O', 'I', 'D', 'L'}) (N * H bytes)
91+
==== OID Lookup (ID: {'O', 'I', 'D', 'L'}) (N * H bytes)
7992
The OIDs for all commits in the graph, sorted in ascending order.
8093

81-
Commit Data (ID: {'C', 'D', 'A', 'T' }) (N * (H + 16) bytes)
94+
==== Commit Data (ID: {'C', 'D', 'A', 'T' }) (N * (H + 16) bytes)
8295
* The first H bytes are for the OID of the root tree.
8396
* The next 8 bytes are for the positions of the first two parents
8497
of the ith commit. Stores value 0x70000000 if no parent in that
@@ -93,7 +106,7 @@ CHUNK DATA:
93106
2 bits of the lowest byte, storing the 33rd and 34th bit of the
94107
commit time.
95108

96-
Generation Data (ID: {'G', 'D', 'A', '2' }) (N * 4 bytes) [Optional]
109+
==== Generation Data (ID: {'G', 'D', 'A', '2' }) (N * 4 bytes) [Optional]
97110
* This list of 4-byte values store corrected commit date offsets for the
98111
commits, arranged in the same order as commit data chunk.
99112
* If the corrected commit date offset cannot be stored within 31 bits,
@@ -104,30 +117,30 @@ CHUNK DATA:
104117
by compatible versions of Git and in case of split commit-graph chains,
105118
the topmost layer also has Generation Data chunk.
106119

107-
Generation Data Overflow (ID: {'G', 'D', 'O', '2' }) [Optional]
120+
==== Generation Data Overflow (ID: {'G', 'D', 'O', '2' }) [Optional]
108121
* This list of 8-byte values stores the corrected commit date offsets
109122
for commits with corrected commit date offsets that cannot be
110123
stored within 31 bits.
111124
* Generation Data Overflow chunk is present only when Generation Data
112125
chunk is present and atleast one corrected commit date offset cannot
113126
be stored within 31 bits.
114127

115-
Extra Edge List (ID: {'E', 'D', 'G', 'E'}) [Optional]
128+
==== Extra Edge List (ID: {'E', 'D', 'G', 'E'}) [Optional]
116129
This list of 4-byte values store the second through nth parents for
117130
all octopus merges. The second parent value in the commit data stores
118131
an array position within this list along with the most-significant bit
119132
on. Starting at that array position, iterate through this list of commit
120133
positions for the parents until reaching a value with the most-significant
121134
bit on. The other bits correspond to the position of the last parent.
122135

123-
Bloom Filter Index (ID: {'B', 'I', 'D', 'X'}) (N * 4 bytes) [Optional]
136+
==== Bloom Filter Index (ID: {'B', 'I', 'D', 'X'}) (N * 4 bytes) [Optional]
124137
* The ith entry, BIDX[i], stores the number of bytes in all Bloom filters
125138
from commit 0 to commit i (inclusive) in lexicographic order. The Bloom
126139
filter for the i-th commit spans from BIDX[i-1] to BIDX[i] (plus header
127140
length), where BIDX[-1] is 0.
128141
* The BIDX chunk is ignored if the BDAT chunk is not present.
129142

130-
Bloom Filter Data (ID: {'B', 'D', 'A', 'T'}) [Optional]
143+
==== Bloom Filter Data (ID: {'B', 'D', 'A', 'T'}) [Optional]
131144
* It starts with header consisting of three unsigned 32-bit integers:
132145
- Version of the hash algorithm being used. We currently only support
133146
value 1 which corresponds to the 32-bit version of the murmur3 hash
@@ -147,13 +160,13 @@ CHUNK DATA:
147160
of length one, with either all bits set to zero or one respectively.
148161
* The BDAT chunk is present if and only if BIDX is present.
149162

150-
Base Graphs List (ID: {'B', 'A', 'S', 'E'}) [Optional]
163+
==== Base Graphs List (ID: {'B', 'A', 'S', 'E'}) [Optional]
151164
This list of H-byte hashes describe a set of B commit-graph files that
152165
form a commit-graph chain. The graph position for the ith commit in this
153166
file's OID Lookup chunk is equal to i plus the number of commits in all
154167
base graphs. If B is non-zero, this chunk must exist.
155168

156-
TRAILER:
169+
=== TRAILER:
157170

158171
H-byte HASH-checksum of all of the above.
159172

@@ -164,3 +177,7 @@ the number '2' in their chunk IDs because a previous version of Git wrote
164177
possibly erroneous data in these chunks with the IDs "GDAT" and "GDOV". By
165178
changing the IDs, newer versions of Git will silently ignore those older
166179
chunks and write the new information without trusting the incorrect data.
180+
181+
GIT
182+
---
183+
Part of the linkgit:git[1] suite

Documentation/technical/chunk-format.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sections of the file. This allows structured access to a large file by
66
scanning a small "table of contents" for the remaining data. This common
77
format is used by the `commit-graph` and `multi-pack-index` files. See
88
link:technical/pack-format.html[the `multi-pack-index` format] and
9-
link:technical/commit-graph-format.html[the `commit-graph` format] for
9+
the `commit-graph` format in linkgit:gitformat-commit-graph[5] for
1010
how they use the chunks to describe structured data.
1111

1212
A chunk-based file format begins with some header information custom to
@@ -108,7 +108,7 @@ for future formats:
108108
* *commit-graph:* see `write_commit_graph_file()` and `parse_commit_graph()`
109109
in `commit-graph.c` for how the chunk-format API is used to write and
110110
parse the commit-graph file format documented in
111-
link:technical/commit-graph-format.html[the commit-graph file format].
111+
the commit-graph file format in linkgit:gitformat-commit-graph[5].
112112

113113
* *multi-pack-index:* see `write_midx_internal()` and `load_multi_pack_index()`
114114
in `midx.c` for how the chunk-format API is used to write and

command-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ gitdiffcore guide
210210
giteveryday guide
211211
gitfaq guide
212212
gitformat-bundle developerinterfaces
213+
gitformat-commit-graph developerinterfaces
213214
gitglossary guide
214215
githooks userinterfaces
215216
gitignore userinterfaces

0 commit comments

Comments
 (0)