# Delta-transfer using thin-pack

2 messages from 2006-02-19 to 2006-02-21. Participants: Junio C Hamano, Martin Langhoff.
Thread: https://gitlist.dev/t/3397

## Junio C Hamano, 2006-02-19 23:27

Subject: Delta-transfer using thin-pack
Message-ID: <7voe13exoq.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7voe13exoq.fsf%40assigned-by-dhcp.cox.net

```
I'll be sending out three experimental patches that would come
on top of "next".  With them, you should be able to:

	$ git send-pack --thin other/repo/sitory

and it would send deltified representation based on things not
in the transferred data.

This is somewhat experimental, although I tried it myself and it
seems to work with my limited test.  Do not push into your
production repository with it yet, but please do try it out.

How does it work?

"git send-pack" works by:

 (1) negotiating with the other end to find out what common
     commits our repository and the other one has;

 (2) computing the list of objects to send to the other end by
     running

     "git-rev-list --objects $heads `git-rev-parse --not $commons`"

     ($heads are what we are going to send, $commons are what
     they already have).

 (3) feeding (2) to git-pack-object --stdout, sending the result
     to the other end.

 (4) invoke git-receive-pack on the other end and have it read
     the output from (3), which will feed git-unpack-objects on
     the other end.

In general, the packfile is designed to be "self contained".
This is necessary in case we need to deal with more than one
huge packfiles that we can mmap only one at a time -- we
guarantee that the base object of a deltified object is found
while unpacking that deltified object because the base object
can always be found in the same pack.

However, during send-pack/receive-pack transfer, we will unpack
the resulting packfile on the other end into loose objects, so
it is not strictly necessary to require self-containedness to
the packfile used for the transfer.

```

## Martin Langhoff, 2006-02-21 02:05

Subject: Re: Delta-transfer using thin-pack
Message-ID: <46a038f90602201805l481af8ddl5b2d30862f61e29@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f90602201805l481af8ddl5b2d30862f61e29%40mail.gmail.com
In-Reply-To: <7voe13exoq.fsf@assigned-by-dhcp.cox.net>

```
On 2/20/06, Junio C Hamano <junkio@cox.net> wrote:
> I'll be sending out three experimental patches that would come
> on top of "next".  With them, you should be able to:

I see that an updated version of this has made it to next & pu.
Cool stuff -- fetched, made, and playing w it ;-)


m

```
