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.