diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-18 16:08:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-07 13:48:47 -0800 |
commit | daebaa78137d59693a808c1f0bdec0ecb40fc12e (patch) | |
tree | 46a71938843dae2dade7b121a5d7c5eb7d6a65a9 /sigchain.c | |
parent | 3f1da57fffdcfb48bd8b85da347f310b955245d7 (diff) | |
download | git-daebaa78137d59693a808c1f0bdec0ecb40fc12e.tar.gz |
upload/receive-pack: allow hiding ref hierarchies
A repository may have refs that are only used for its internal
bookkeeping purposes that should not be exposed to the others that
come over the network.
Teach upload-pack to omit some refs from its initial advertisement
by paying attention to the uploadpack.hiderefs multi-valued
configuration variable. Do the same to receive-pack via the
receive.hiderefs variable. As a convenient short-hand, allow using
transfer.hiderefs to set the value to both of these variables.
Any ref that is under the hierarchies listed on the value of these
variable is excluded from responses to requests made by "ls-remote",
"fetch", etc. (for upload-pack) and "push" (for receive-pack).
Because these hidden refs do not count as OUR_REF, an attempt to
fetch objects at the tip of them will be rejected, and because these
refs do not get advertised, "git push :" will not see local branches
that have the same name as them as "matching" ones to be sent.
An attempt to update/delete these hidden refs with an explicit
refspec, e.g. "git push origin :refs/hidden/22", is rejected. This
is not a new restriction. To the pusher, it would appear that there
is no such ref, so its push request will conclude with "Now that I
sent you all the data, it is time for you to update the refs. I saw
that the ref did not exist when I started pushing, and I want the
result to point at this commit". The receiving end will apply the
compare-and-swap rule to this request and rejects the push with
"Well, your update request conflicts with somebody else; I see there
is such a ref.", which is the right thing to do. Otherwise a push to
a hidden ref will always be "the last one wins", which is not a good
default.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sigchain.c')
0 files changed, 0 insertions, 0 deletions