From: "Shawn O. Pearce" <spearce@spearce•org>
To: Peter Eriksen <s022018@student•dtu.dk>
Cc: git@vger•kernel.org
Subject: Re: [PATCH] Add description of OFS_DELTA to the pack format description
Date: Sun, 6 Apr 2008 15:07:24 -0400 [thread overview]
Message-ID: <20080406190724.GG10274@spearce.org> (raw)
In-Reply-To: <20080406134739.GA29815@bohr.gbar.dtu.dk>
Peter Eriksen <s022018@student•dtu.dk> wrote:
> diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt
> index aa87756..f6b1405 100644
> --- a/Documentation/technical/pack-format.txt
> +++ b/Documentation/technical/pack-format.txt
> @@ -103,10 +103,20 @@ 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) (the size above is the
> + size of the delta data that follows).
> + delta data, deflated.
You are missing the description that the position within _this_
packfile is determined by:
offset_of_type_byte - n_byte_offset
The above can still be taken to mean the offset is from the start
of the packfile or something like that.
> + 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
> + adding 2^7 + 2^14 + ... + 2^(7*(n-1)) to the result.
Hmm. I've just spent 5 minutes reading this and I'm still not
certain what the result is. 2^0 only gets added to the result if
there is at least 2 bytes of data in the offset encoding; in your
description above it sounds like we should add 2^0 (1) even when
there is only 1 offset byte (n=1), which is not correct.
--
Shawn.
next prev parent reply other threads:[~2008-04-06 19:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-06 13:47 [PATCH] Add description of OFS_DELTA to the pack format description Peter Eriksen
2008-04-06 19:07 ` Shawn O. Pearce [this message]
2008-04-06 20:19 ` [PATCH v2] " Peter Eriksen
2008-04-06 20:28 ` Shawn O. Pearce
2008-04-06 20:51 ` [PATCH v3] " Peter Eriksen
2008-04-06 22:26 ` Shawn O. Pearce
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080406190724.GG10274@spearce.org \
--to=spearce@spearce$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=s022018@student$(echo .)dtu.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox