index-format.txt: clarify what is "invalid"
A cache-tree entry with a negative entry count is considered invalid by the current Git; it records that we do not know the object name of a tree that would result by writing the directory covered by the cache-tree as a tree object. Clarify that any entry with a negative entry count is invalid, but the implementations must write -1 there. This way, we can later decide to allow writers to use negative values other than -1 to encode optional information on such invalidated entries without harming interoperability; we do not know what will be encoded and how, so we keep these other negative values as reserved for now. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Dec 13, 2012 at 08:14 UTC
4a6385fe555f810e8168399df673d00addffb721
1 file changed
+3
-2
Documentation/technical/index-format.txt
+3
-2
@@ -161,8 +161,9 @@ GIT index format
161
this span of index as a tree.
162
163
An entry can be in an invalidated state and is represented by having
164
- -1 in the entry_count field. In this case, there is no object name
165
- and the next entry starts immediately after the newline.
164
+ a negative number in the entry_count field. In this case, there is no
165
+ object name and the next entry starts immediately after the newline.
166
+ When writing an invalid entry, -1 should always be used as entry_count.
167
168
The entries are written out in the top-down, depth-first order. The
169
first entry represents the root level of the repository, followed by the