Skip to content

Commit

Permalink
index-v4: document the entry format
Browse files Browse the repository at this point in the history
Document the format so that others can learn from and build on top of
the series.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Apr 27, 2012
1 parent 9170c7a commit afd7bd2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Documentation/technical/index-format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,22 @@ GIT index format
are encoded in 7-bit ASCII and the encoding cannot contain a NUL
byte (iow, this is a UNIX pathname).

(Version 4) In version 4, the entry path name is prefix-compressed
relative to the path name for the previous entry (the very first
entry is encoded as if the path name for the previous entry is an
empty string). At the beginning of an entry, an integer N in the
variable width encoding (the same encoding as the offset is encoded
for OFS_DELTA pack entries; see pack-format.txt) is stored, followed
by a NUL-terminated string S. Removing N bytes from the end of the
path name for the previous entry, and replacing it with the string S
yields the path name for this entry.

1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes
while keeping the name NUL-terminated.

(Version 4) In version 4, the padding after the pathname does not
exist.

== Extensions

=== Cached tree
Expand Down

0 comments on commit afd7bd2

Please sign in to comment.