fetch: add --unshallow for turning shallow repo into complete one
[gitweb.git] / Documentation / technical / pack-format.txt
index aa87756a55dfe6337f06b8aece0ed88d092036b1..a7871fb865d9c41f26011d6fd06c531538c2379e 100644 (file)
@@ -1,7 +1,7 @@
 GIT pack format
 ===============
 
-= pack-*.pack files have the following format:
+== pack-*.pack files have the following format:
 
    - A header appears at the beginning and consists of the following:
 
@@ -34,7 +34,7 @@ GIT pack format
 
   - The trailer records 20-byte SHA1 checksum of all of the above.
 
-= Original (version 1) pack-*.idx files have the following format:
+== Original (version 1) pack-*.idx files have the following format:
 
   - The header consists of 256 4-byte network byte order
     integers.  N-th entry of this table records the number of
@@ -103,14 +103,28 @@ Pack file entry: <+
      packed object data:
         If it is not DELTA, then deflated bytes (the size above
                is the size before compression).
-       If it is DELTA, then
+       If it is REF_DELTA, then
          20-byte base object name SHA1 (the size above is the
                size of the delta data that follows).
           delta data, deflated.
+       If it is OFS_DELTA, then
+         n-byte offset (see below) interpreted as a negative
+               offset from the type-byte of the header of the
+               ofs-delta entry (the size above is the size of
+               the delta data that follows).
+         delta data, deflated.
 
+     offset encoding:
+         n bytes with MSB set in all but the last one.
+         The offset is then the number constructed by
+         concatenating the lower 7 bit of each byte, and
+         for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1))
+         to the result.
 
-= Version 2 pack-*.idx files support packs larger than 4 GiB, and
-  have some other reorganizations.  They have the format:
+
+
+== Version 2 pack-*.idx files support packs larger than 4 GiB, and
+   have some other reorganizations.  They have the format:
 
   - A 4-byte magic number '\377tOc' which is an unreasonable
     fanout[0] value.