git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Understanding Binary Deltas within Packfile
@ 2018-03-20 15:43 Luke Robison
  2018-03-20 16:03 ` Duy Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Luke Robison @ 2018-03-20 15:43 UTC (permalink / raw)
  To: git

Is there any documentation of the contents of the binary delta datain a 
packfile, and how to interpret them?  I found 
https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt 
documenting the packfile itself, but the "compressed delta data" seems 
largely undocumented.  The source code of 
https://github.com/git/git/blob/master/diff-delta.c is pretty dense.  
This is what I've got so for:

+-------------+
| Varint src_size
| Varint trg_size
| 1-byte inscnt
| N-bytes up to 16 bytes of trg_buf
|
| A series of Operations
|
+-------------


Any details on how to interpret the opcodes would be greatly appreciated.

Thanks,
Luke


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Understanding Binary Deltas within Packfile
  2018-03-20 15:43 Understanding Binary Deltas within Packfile Luke Robison
@ 2018-03-20 16:03 ` Duy Nguyen
  2018-03-20 18:34   ` Luke Robison
  0 siblings, 1 reply; 4+ messages in thread
From: Duy Nguyen @ 2018-03-20 16:03 UTC (permalink / raw)
  To: Luke Robison; +Cc: Git Mailing List

On Tue, Mar 20, 2018 at 4:43 PM, Luke Robison <robison@arlut.utexas.edu> wrote:
> Is there any documentation of the contents of the binary delta datain a
> packfile, and how to interpret them?  I found
> https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt
> documenting the packfile itself, but the "compressed delta data" seems
> largely undocumented.  The source code of
> https://github.com/git/git/blob/master/diff-delta.c is pretty dense.

The output is consumed by patch_delta()  in patch-delta.c if I'm not
mistaken. This function is less than 100 lines, probably much easier
to see the delta format.

>  This
> is what I've got so for:
>
> +-------------+
> | Varint src_size
> | Varint trg_size
> | 1-byte inscnt
> | N-bytes up to 16 bytes of trg_buf
> |
> | A series of Operations
> |
> +-------------
>
>
> Any details on how to interpret the opcodes would be greatly appreciated.
>
> Thanks,
> Luke
>



-- 
Duy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Understanding Binary Deltas within Packfile
  2018-03-20 16:03 ` Duy Nguyen
@ 2018-03-20 18:34   ` Luke Robison
  2018-03-20 19:12     ` Duy Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Luke Robison @ 2018-03-20 18:34 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

On 3/20/2018 11:03 AM, Duy Nguyen wrote:
> On Tue, Mar 20, 2018 at 4:43 PM, Luke Robison <robison@arlut.utexas.edu> wrote:
>> Is there any documentation of the contents of the binary delta datain a
>> packfile, and how to interpret them?  I found
>> https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt
>> documenting the packfile itself, but the "compressed delta data" seems
>> largely undocumented.  The source code of
>> https://github.com/git/git/blob/master/diff-delta.c is pretty dense.
> The output is consumed by patch_delta()  in patch-delta.c if I'm not
> mistaken. This function is less than 100 lines, probably much easier
> to see the delta format.
Thank you, that was much easier to read, and I've got my prototype 
working now.  I also found this site to be quite helpful:
http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/#delta_encoding




[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4311 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Understanding Binary Deltas within Packfile
  2018-03-20 18:34   ` Luke Robison
@ 2018-03-20 19:12     ` Duy Nguyen
  0 siblings, 0 replies; 4+ messages in thread
From: Duy Nguyen @ 2018-03-20 19:12 UTC (permalink / raw)
  To: Luke Robison; +Cc: Git Mailing List

On Tue, Mar 20, 2018 at 7:34 PM, Luke Robison <robison@arlut.utexas.edu> wrote:
> On 3/20/2018 11:03 AM, Duy Nguyen wrote:
>>
>> On Tue, Mar 20, 2018 at 4:43 PM, Luke Robison <robison@arlut.utexas.edu>
>> wrote:
>>>
>>> Is there any documentation of the contents of the binary delta datain a
>>> packfile, and how to interpret them?  I found
>>>
>>> https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt
>>> documenting the packfile itself, but the "compressed delta data" seems
>>> largely undocumented.  The source code of
>>> https://github.com/git/git/blob/master/diff-delta.c is pretty dense.
>>
>> The output is consumed by patch_delta()  in patch-delta.c if I'm not
>> mistaken. This function is less than 100 lines, probably much easier
>> to see the delta format.
>
> Thank you, that was much easier to read, and I've got my prototype working
> now.  I also found this site to be quite helpful:
> http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/#delta_encoding

By the way, I forgot to add, if you want to improve pack-format.txt
(since you study it anyway), patches are always welcome.
-- 
Duy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-20 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 15:43 Understanding Binary Deltas within Packfile Luke Robison
2018-03-20 16:03 ` Duy Nguyen
2018-03-20 18:34   ` Luke Robison
2018-03-20 19:12     ` Duy Nguyen

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git