git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] index-format.txt: be more liberal on what can represent invalid cache tree

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Dec 12, 2012, 12:44 UTC
Message-ID
<1355316276-7661-1-git-send-email-pclouds@gmail.com>

We have been writing -1 as "invalid" since day 1. On that same day we accept all negative entry counts as "invalid". So in theory all C Git versions out there would be happy to accept any negative numbers. JGit seems to do exactly the same.

Correct the document to reflect the fact that -1 is not the only magic number. At least one implementation, libgit2, is found to treat -1 this way.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/technical/index-format.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
index 9d25b30..2028a49 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/technical/index-format.txt
@@ -161,8 +161,8 @@ GIT index format
     this span of index as a tree.
 
   An entry can be in an invalidated state and is represented by having
-  -1 in the entry_count field. In this case, there is no object name
-  and the next entry starts immediately after the newline.
+  a negative number in the entry_count field. In this case, there is no
+  object name and the next entry starts immediately after the newline.
 
   The entries are written out in the top-down, depth-first order.  The
   first entry represents the root level of the repository, followed by the
-- 
1.8.0.rc2.23.g1fb49df
Next: Junio C Hamano
Message 1 of 5 in “index-format.txt: be more liberal on what can represent invalid cache tree”
  1. index-format.txt: be more liberal on what can represent invalid cache treeNguyễn Thái Ngọc Duy, Dec 12, 2012
  2. Junio C HamanoDec 12, 2012
  3. index-format.txt: be more liberal on what can represent invalid cache treeNguyễn Thái Ngọc Duy, Dec 13, 2012
  4. Junio C HamanoDec 13, 2012
  5. Junio C HamanoDec 13, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.