]> git.ipfire.org Git - thirdparty/git.git/commit - fetch-pack.c
upload-pack: optionally allow fetching reachable sha1
authorFredrik Medley <fredrik.medley@gmail.com>
Thu, 21 May 2015 20:23:39 +0000 (22:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 May 2015 01:25:36 +0000 (18:25 -0700)
commit68ee628932c2196742b77d2961c5e16360734a62
treed291d037badd372d77b6d405c2984858beba4f1e
parent7199c093ad4a90bd0d9012681b6a148ab8c945e3
upload-pack: optionally allow fetching reachable sha1

With uploadpack.allowReachableSHA1InWant configuration option set on the
server side, "git fetch" can make a request with a "want" line that names
an object that has not been advertised (likely to have been obtained out
of band or from a submodule pointer). Only objects reachable from the
branch tips, i.e. the union of advertised branches and branches hidden by
transfer.hideRefs, will be processed. Note that there is an associated
cost of having to walk back the history to check the reachability.

This feature can be used when obtaining the content of a certain commit,
for which the sha1 is known, without the need of cloning the whole
repository, especially if a shallow fetch is used. Useful cases are e.g.
repositories containing large files in the history, fetching only the
needed data for a submodule checkout, when sharing a sha1 without telling
which exact branch it belongs to and in Gerrit, if you think in terms of
commits instead of change numbers. (The Gerrit case has already been
solved through allowTipSHA1InWant as every Gerrit change has a ref.)

Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
Documentation/technical/http-protocol.txt
Documentation/technical/protocol-capabilities.txt
fetch-pack.c
t/t5516-fetch-push.sh
upload-pack.c