]> git.ipfire.org Git - thirdparty/git.git/commit - cache.h
push: prepare sender to receive extended ref information from the receiver
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Sep 2008 08:27:09 +0000 (01:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Sep 2008 16:27:46 +0000 (09:27 -0700)
commit40c155ff14c8b313d408f2e51a55c881ce082e4e
tree97509e2459ec5eac8e771d5ea2b131fc8faacc8d
parentbe5908aed35d1c129f1ea38913b230ee1927361b
push: prepare sender to receive extended ref information from the receiver

"git push" enhancement allows the receiving end to report not only its own
refs but refs in repositories it borrows from via the alternate object
store mechanism.  By telling the sender that objects reachable from these
extra refs are already complete in the receiving end, the number of
objects that need to be transfered can be cut down.

These entries are sent over the wire with string ".have", instead of the
actual names of the refs.  This string was chosen so that they are ignored
by older programs at the sending end.  If we sent some random but valid
looking refnames for these entries, "matching refs" rule (triggered when
running "git push" without explicit refspecs, where the sender learns what
refs the receiver has, and updates only the ones with the names of the
refs the sender also has) and "delete missing" rule (triggered when "git
push --mirror" is used, where the sender tells the receiver to delete the
refs it itself does not have) would try to update/delete them, which is
not what we want.

This prepares the send-pack (and "push" that runs native protocol) to
accept extended existing ref information and make use of it.  The ".have"
entries are excluded from ref matching rules, and are exempt from deletion
rule while pushing with --mirror option, but are still used for pack
generation purposes by providing more "bottom" range commits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c
builtin-send-pack.c
cache.h
connect.c
transport.c