Skip to content

Commit fb3010c

Browse files
peffgitster
authored andcommitted
show-index: update documentation for index v2
Commit 32637cd (show-index.c: learn about index v2, 2007-04-09) changed the output format of show-index to include the object CRC32 but didn't update the documentation. Let's fix that and generally describe the output in more detail. There are a few other fixes here while we're rewording: - refer to index-pack along with pack-objects, since either can create .idx files - use "linkgit:" for referring to other commands - expand the bit about verify-pack, giving reasons why you might want this command instead. I almost omitted this entirely, but referring to verify-pack might help a reader who is looking for more information. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ff41726 commit fb3010c

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

Documentation/git-show-index.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,27 @@ SYNOPSIS
1414

1515
DESCRIPTION
1616
-----------
17-
Read the idx file for a Git packfile created with
18-
'git pack-objects' command from the standard input, and
19-
dump its contents.
17+
Read the `.idx` file for a Git packfile (created with
18+
linkgit:git-pack-objects[1] or linkgit:git-index-pack[1]) from the
19+
standard input, and dump its contents. The output consists of one object
20+
per line, with each line containing two or three space-separated
21+
columns:
2022

21-
The information it outputs is subset of what you can get from
22-
'git verify-pack -v'; this command only shows the packfile
23-
offset and SHA-1 of each object.
23+
- the first column is the offset in bytes of the object within the
24+
corresponding packfile
25+
26+
- the second column is the object id of the object
27+
28+
- if the index version is 2 or higher, the third column contains the
29+
CRC32 of the object data
30+
31+
The objects are output in the order in which they are found in the index
32+
file, which should be (in a correctly constructed file) sorted by object
33+
id.
34+
35+
Note that you can get more information on a packfile by calling
36+
linkgit:git-verify-pack[1]. However, as this command considers only the
37+
index file itself, it's both faster and more flexible.
2438

2539
GIT
2640
---

0 commit comments

Comments
 (0)