index-v4: document the entry format

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>

Junio C Hamano committed Apr 27, 2012 at 16:02 UTC afd7bd22209c53ae4d3c73dd4bc4b225ec55e10a
1 file changed +13
Documentation/technical/index-format.txt
+13
@@ -113,9 +113,22 @@ GIT index format
113 are encoded in 7-bit ASCII and the encoding cannot contain a NUL
114 byte (iow, this is a UNIX pathname).
115
116 + (Version 4) In version 4, the entry path name is prefix-compressed
117 + relative to the path name for the previous entry (the very first
118 + entry is encoded as if the path name for the previous entry is an
119 + empty string). At the beginning of an entry, an integer N in the
120 + variable width encoding (the same encoding as the offset is encoded
121 + for OFS_DELTA pack entries; see pack-format.txt) is stored, followed
122 + by a NUL-terminated string S. Removing N bytes from the end of the
123 + path name for the previous entry, and replacing it with the string S
124 + yields the path name for this entry.
125 +
126 1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes
127 while keeping the name NUL-terminated.
128
129 + (Version 4) In version 4, the padding after the pathname does not
130 + exist.
131 +
132 == Extensions
133
134 === Cached tree