eoie: add End of Index Entry (EOIE) extension
[gitweb.git] / Documentation / technical / index-format.txt
index db3572626beba6fc04f169b4ccccca0084d7326b..6bc2d90f7f3d8357cd9b6a801b781b2f3f0628d4 100644 (file)
@@ -314,3 +314,26 @@ The remaining data of each directory block is grouped by type:
 
   - An ewah bitmap, the n-th bit indicates whether the n-th index entry
     is not CE_FSMONITOR_VALID.
+
+== End of Index Entry
+
+  The End of Index Entry (EOIE) is used to locate the end of the variable
+  length index entries and the begining of the extensions. Code can take
+  advantage of this to quickly locate the index extensions without having
+  to parse through all of the index entries.
+
+  Because it must be able to be loaded before the variable length cache
+  entries and other index extensions, this extension must be written last.
+  The signature for this extension is { 'E', 'O', 'I', 'E' }.
+
+  The extension consists of:
+
+  - 32-bit offset to the end of the index entries
+
+  - 160-bit SHA-1 over the extension types and their sizes (but not
+       their contents).  E.g. if we have "TREE" extension that is N-bytes
+       long, "REUC" extension that is M-bytes long, followed by "EOIE",
+       then the hash would be:
+
+       SHA-1("TREE" + <binary representation of N> +
+               "REUC" + <binary representation of M>)