1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 06:56:10 +02:00
git/Documentation/git-show-index.txt
brian m. carlson 88a09a557c builtin/show-index: provide options to determine hash algo
show-index is capable of reading any possible index file whether or not
the index is inside a repository.  However, because our index files lack
metadata about the hash algorithm in use, it's not possible to
autodetect the algorithm that a particular index file is using.

In order to allow us to read index files of any algorithm, let's set up
the .git directory gently so that we default to the algorithm for the
current repository, and add an --object-format option to allow users to
override this setting and continue to run show-index outside of a
repository altogether.  Let's also document this new option so that
people can find it and use it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-27 10:07:07 -07:00

51 lines
1.4 KiB
Plaintext

git-show-index(1)
=================
NAME
----
git-show-index - Show packed archive index
SYNOPSIS
--------
[verse]
'git show-index' [--object-format=<hash-algorithm>]
DESCRIPTION
-----------
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 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.
OPTIONS
-------
--object-format=<hash-algorithm>::
Specify the given object format (hash algorithm) for the index file. The
valid values are 'sha1' and (if enabled) 'sha256'. The default is the
algorithm for the current repository (set by `extensions.objectFormat`), or
'sha1' if no value is set or outside a repository..
GIT
---
Part of the linkgit:git[1] suite