show-index: update documentation for index v2
authorJeff King <peff@peff.net>
Mon, 28 May 2018 09:39:23 +0000 (05:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 May 2018 15:28:22 +0000 (00:28 +0900)
Commit 32637cdf4a (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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-show-index.txt
index a8a9509e0eb0bb416ce0a32f76c964a505da8f61..424e4ba84cf9b0444a41f0a163de0a58a6ac378a 100644 (file)
@@ -14,13 +14,27 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
-Read the idx file for a Git packfile created with
-'git pack-objects' command from the standard input, and
-dump its contents.
+Read the `.idx` file for a Git packfile (created with
+linkgit:git-pack-objects[1] or linkgit:git-index-pack[1]) from the
+standard input, and dump its contents. The output consists of one object
+per line, with each line containing two or three space-separated
+columns:
 
-The information it outputs is subset of what you can get from
-'git verify-pack -v'; this command only shows the packfile
-offset and SHA-1 of each object.
+  - the first column is the offset in bytes of the object within the
+    corresponding packfile
+
+  - the second column is the object id of the object
+
+  - if the index version is 2 or higher, the third column contains the
+    CRC32 of the object data
+
+The objects are output in the order in which they are found in the index
+file, which should be (in a correctly constructed file) sorted by object
+id.
+
+Note that you can get more information on a packfile by calling
+linkgit:git-verify-pack[1]. However, as this command considers only the
+index file itself, it's both faster and more flexible.
 
 GIT
 ---