threads / discuss / 3397

Delta-transfer using thin-pack

Subject: Delta-transfer using thin-pack

## tl;dr

2 messages between Feb 19, 2006 and Feb 21, 2006.

replies: 1people: 2as markdown or json

Junio C Hamano· Feb 19, 2006, 23:27 UTC · lore

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· Feb 21, 2006, 02:05 UTC · re: Junio C Hamano · lore

Re: Delta-transfer using thin-pack

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

← back to recent threads