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>
This commit is contained in:

committed by
Junio C Hamano

parent
7199c093ad
commit
68ee628932
@ -319,7 +319,8 @@ Servers SHOULD support all capabilities defined here.
|
||||
Clients MUST send at least one "want" command in the request body.
|
||||
Clients MUST NOT reference an id in a "want" command which did not
|
||||
appear in the response obtained through ref discovery unless the
|
||||
server advertises capability `allow-tip-sha1-in-want`.
|
||||
server advertises capability `allow-tip-sha1-in-want` or
|
||||
`allow-reachable-sha1-in-want`.
|
||||
|
||||
compute_request = want_list
|
||||
have_list
|
||||
|
@ -260,6 +260,13 @@ If the upload-pack server advertises this capability, fetch-pack may
|
||||
send "want" lines with SHA-1s that exist at the server but are not
|
||||
advertised by upload-pack.
|
||||
|
||||
allow-reachable-sha1-in-want
|
||||
----------------------------
|
||||
|
||||
If the upload-pack server advertises this capability, fetch-pack may
|
||||
send "want" lines with SHA-1s that exist at the server but are not
|
||||
advertised by upload-pack.
|
||||
|
||||
push-cert=<nonce>
|
||||
-----------------
|
||||
|
||||
|
Reference in New Issue
Block a user