{"thread":{"id":"13001","subject":"[PATCH] Add description of OFS_DELTA to the pack format description","startedAt":"2008-04-06T13:47:39Z","lastAt":"2008-04-06T22:26:36Z","messageCount":6,"participants":["Peter Eriksen","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73741","messageId":"20080406134739.GA29815@bohr.gbar.dtu.dk","threadId":"13001","inReplyTo":null,"subject":"[PATCH] Add description of OFS_DELTA to the pack format description","fromName":"Peter Eriksen","fromEmail":"s022018@student.dtu.dk","sentAt":"2008-04-06T13:47:39Z","receivedAt":"2008-04-06T13:47:39Z","isPatch":true,"sender":{"key":"s022018@student.dtu.dk","avatar":null},"body":"\n\nSigned-off-by: Peter Eriksen <s022018@student.dtu.dk>\n---\n\nI'll take it in smaller steps this time.\n\n Documentation/technical/pack-format.txt |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt\nindex aa87756..f6b1405 100644\n--- a/Documentation/technical/pack-format.txt\n+++ b/Documentation/technical/pack-format.txt\n@@ -103,10 +103,20 @@ Pack file entry: <+\n      packed object data:\n         If it is not DELTA, then deflated bytes (the size above\n \t\tis the size before compression).\n-\tIf it is DELTA, then\n+\tIf it is REF_DELTA, then\n \t  20-byte base object name SHA1 (the size above is the\n \t\tsize of the delta data that follows).\n           delta data, deflated.\n+\tIf it is OFS_DELTA, then\n+\t  n-byte offset (see below) (the size above is the\n+\t\tsize of the delta data that follows).\n+          delta data, deflated.\n+\n+     offset encoding:\n+          n bytes with MSB set in all but the last one.\n+          The offset is then the number constructed by\n+          concatenating the lower 7 bit of each byte, and\n+          adding 2^7 + 2^14 + ... + 2^(7*(n-1)) to the result.\n \n \n = Version 2 pack-*.idx files support packs larger than 4 GiB, and\n-- \n1.5.5-rc3.GIT\n"},{"id":"73764","messageId":"20080406190724.GG10274@spearce.org","threadId":"13001","inReplyTo":"20080406134739.GA29815@bohr.gbar.dtu.dk","subject":"Re: [PATCH] Add description of OFS_DELTA to the pack format description","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-06T19:07:24Z","receivedAt":"2008-04-06T19:07:24Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Peter Eriksen <s022018@student.dtu.dk> wrote:\n> diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt\n> index aa87756..f6b1405 100644\n> --- a/Documentation/technical/pack-format.txt\n> +++ b/Documentation/technical/pack-format.txt\n> @@ -103,10 +103,20 @@ Pack file entry: <+\n>       packed object data:\n>          If it is not DELTA, then deflated bytes (the size above\n>  \t\tis the size before compression).\n> -\tIf it is DELTA, then\n> +\tIf it is REF_DELTA, then\n>  \t  20-byte base object name SHA1 (the size above is the\n>  \t\tsize of the delta data that follows).\n>            delta data, deflated.\n> +\tIf it is OFS_DELTA, then\n> +\t  n-byte offset (see below) (the size above is the\n> +\t\tsize of the delta data that follows).\n> +          delta data, deflated.\n\nYou are missing the description that the position within _this_\npackfile is determined by:\n\n\toffset_of_type_byte - n_byte_offset\n\nThe above can still be taken to mean the offset is from the start\nof the packfile or something like that.\n\n> +     offset encoding:\n> +          n bytes with MSB set in all but the last one.\n> +          The offset is then the number constructed by\n> +          concatenating the lower 7 bit of each byte, and\n> +          adding 2^7 + 2^14 + ... + 2^(7*(n-1)) to the result.\n\nHmm.  I've just spent 5 minutes reading this and I'm still not\ncertain what the result is.  2^0 only gets added to the result if\nthere is at least 2 bytes of data in the offset encoding; in your\ndescription above it sounds like we should add 2^0 (1) even when\nthere is only 1 offset byte (n=1), which is not correct.\n\n-- \nShawn.\n"},{"id":"73769","messageId":"20080406201907.GB7075@bohr.gbar.dtu.dk","threadId":"13001","inReplyTo":"20080406190724.GG10274@spearce.org","subject":"[PATCH v2] Add description of OFS_DELTA to the pack format description","fromName":"Peter Eriksen","fromEmail":"s022018@student.dtu.dk","sentAt":"2008-04-06T20:19:07Z","receivedAt":"2008-04-06T20:19:07Z","isPatch":true,"sender":{"key":"s022018@student.dtu.dk","avatar":null},"body":"\nSigned-off-by: Peter Eriksen <s022018@student.dtu.dk>\n---\n Documentation/technical/pack-format.txt |   16 +++++++++++++++-\n 1 files changed, 15 insertions(+), 1 deletions(-)\n\n\nOn Sun, Apr 06, 2008 at 03:07:24PM -0400, Shawn O. Pearce wrote:\n...\n> You are missing the description that the position within _this_\n> packfile is determined by:\n> \n> \toffset_of_type_byte - n_byte_offset\n> \n> The above can still be taken to mean the offset is from the start\n> of the packfile or something like that.\n\nYes, I misunderstood that.\n\nPeter\n\ndiff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt\nindex aa87756..953c7ee 100644\n--- a/Documentation/technical/pack-format.txt\n+++ b/Documentation/technical/pack-format.txt\n@@ -103,10 +103,24 @@ Pack file entry: <+\n      packed object data:\n         If it is not DELTA, then deflated bytes (the size above\n \t\tis the size before compression).\n-\tIf it is DELTA, then\n+\tIf it is REF_DELTA, then\n \t  20-byte base object name SHA1 (the size above is the\n \t\tsize of the delta data that follows).\n           delta data, deflated.\n+\tIf it is OFS_DELTA, then\n+\t  n-byte offset (see below) counted from the type-byte\n+                of the header of the ofs-delta entry.\n+                (the size above is the size of the delta data\n+                that follows).\n+          delta data, deflated.\n+\n+     offset encoding:\n+          n bytes with MSB set in all but the last one.\n+          The offset is then the number constructed by\n+          concatenating the lower 7 bit of each byte, and\n+          for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1))\n+          to the result.\n+          \n \n \n = Version 2 pack-*.idx files support packs larger than 4 GiB, and\n-- \n1.5.5-rc3.GIT\n"},{"id":"73770","messageId":"20080406202821.GN10274@spearce.org","threadId":"13001","inReplyTo":"20080406201907.GB7075@bohr.gbar.dtu.dk","subject":"Re: [PATCH v2] Add description of OFS_DELTA to the pack format description","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-06T20:28:21Z","receivedAt":"2008-04-06T20:28:21Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Peter Eriksen <s022018@student.dtu.dk> wrote:\n> \n> diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt\n> index aa87756..953c7ee 100644\n> --- a/Documentation/technical/pack-format.txt\n> +++ b/Documentation/technical/pack-format.txt\n> @@ -103,10 +103,24 @@ Pack file entry: <+\n>       packed object data:\n>          If it is not DELTA, then deflated bytes (the size above\n>  \t\tis the size before compression).\n> -\tIf it is DELTA, then\n> +\tIf it is REF_DELTA, then\n>  \t  20-byte base object name SHA1 (the size above is the\n>  \t\tsize of the delta data that follows).\n>            delta data, deflated.\n> +\tIf it is OFS_DELTA, then\n> +\t  n-byte offset (see below) counted from the type-byte\n> +                of the header of the ofs-delta entry.\n\nExcept that only a positive offset value is here, as it is always\na treated as a negative offset (you can only refer to a base that\nwas before you, as that is the only way to know the base's offset\nin the pack).\n\n> +                (the size above is the size of the delta data\n> +                that follows).\n> +          delta data, deflated.\n> +\n> +     offset encoding:\n> +          n bytes with MSB set in all but the last one.\n> +          The offset is then the number constructed by\n> +          concatenating the lower 7 bit of each byte, and\n> +          for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1))\n> +          to the result.\n\nYes, that sounds correct.\n\n-- \nShawn.\n"},{"id":"73777","messageId":"20080406205149.GD7075@bohr.gbar.dtu.dk","threadId":"13001","inReplyTo":"20080406202821.GN10274@spearce.org","subject":"[PATCH v3] Add description of OFS_DELTA to the pack format description","fromName":"Peter Eriksen","fromEmail":"s022018@student.dtu.dk","sentAt":"2008-04-06T20:51:49Z","receivedAt":"2008-04-06T20:51:49Z","isPatch":true,"sender":{"key":"s022018@student.dtu.dk","avatar":null},"body":"\nSigned-off-by: Peter Eriksen <s022018@student.dtu.dk>\n---\n Documentation/technical/pack-format.txt |   16 +++++++++++++++-\n 1 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt\nindex aa87756..6b2170f 100644\n--- a/Documentation/technical/pack-format.txt\n+++ b/Documentation/technical/pack-format.txt\n@@ -103,10 +103,24 @@ Pack file entry: <+\n      packed object data:\n         If it is not DELTA, then deflated bytes (the size above\n \t\tis the size before compression).\n-\tIf it is DELTA, then\n+\tIf it is REF_DELTA, then\n \t  20-byte base object name SHA1 (the size above is the\n \t\tsize of the delta data that follows).\n           delta data, deflated.\n+\tIf it is OFS_DELTA, then\n+\t  n-byte offset (see below) interpreted as a negative\n+                offset from the type-byte of the header of the\n+                ofs-delta entry (the size above is the size of\n+                the delta data that follows).\n+          delta data, deflated.\n+\n+     offset encoding:\n+          n bytes with MSB set in all but the last one.\n+          The offset is then the number constructed by\n+          concatenating the lower 7 bit of each byte, and\n+          for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1))\n+          to the result.\n+          \n \n \n = Version 2 pack-*.idx files support packs larger than 4 GiB, and\n-- \n1.5.5-rc3.GIT\n"},{"id":"73786","messageId":"20080406222636.GP10274@spearce.org","threadId":"13001","inReplyTo":"20080406205149.GD7075@bohr.gbar.dtu.dk","subject":"Re: [PATCH v3] Add description of OFS_DELTA to the pack format description","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-06T22:26:36Z","receivedAt":"2008-04-06T22:26:36Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Peter Eriksen <s022018@student.dtu.dk> wrote:\n> -\tIf it is DELTA, then\n> +\tIf it is REF_DELTA, then\n>  \t  20-byte base object name SHA1 (the size above is the\n>  \t\tsize of the delta data that follows).\n>            delta data, deflated.\n> +\tIf it is OFS_DELTA, then\n> +\t  n-byte offset (see below) interpreted as a negative\n> +                offset from the type-byte of the header of the\n> +                ofs-delta entry (the size above is the size of\n> +                the delta data that follows).\n> +          delta data, deflated.\n> +\n> +     offset encoding:\n> +          n bytes with MSB set in all but the last one.\n> +          The offset is then the number constructed by\n> +          concatenating the lower 7 bit of each byte, and\n> +          for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1))\n> +          to the result.\n> +          \n\nYup.  :-)\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n-- \nShawn.\n"}]}