Skip to content

Commit 24a6e5b

Browse files
kimgitster
authored andcommitted
docs: clarify the interaction of transfer.hideRefs and namespaces
Expand the section about namespaces in the documentation of `transfer.hideRefs` to point out the subtle differences between `upload-pack` and `receive-pack`. 9bedd82 (upload-pack.c: treat want-ref relative to namespace, 2021-07-30) taught `upload-pack` to reject `want-ref`s for hidden refs, which is now documented. Signed-off-by: Kim Altintop <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f8121e6 commit 24a6e5b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Documentation/config/transfer.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ If you have multiple hideRefs values, later entries override earlier ones
5252
(and entries in more-specific config files override less-specific ones).
5353
+
5454
If a namespace is in use, the namespace prefix is stripped from each
55-
reference before it is matched against `transfer.hiderefs` patterns.
56-
For example, if `refs/heads/master` is specified in `transfer.hideRefs` and
57-
the current namespace is `foo`, then `refs/namespaces/foo/refs/heads/master`
58-
is omitted from the advertisements but `refs/heads/master` and
59-
`refs/namespaces/bar/refs/heads/master` are still advertised as so-called
60-
"have" lines. In order to match refs before stripping, add a `^` in front of
61-
the ref name. If you combine `!` and `^`, `!` must be specified first.
55+
reference before it is matched against `transfer.hiderefs` patterns. For
56+
example, if `refs/heads/master` is specified in `transfer.hideRefs` and the
57+
current namespace is `foo`, then `refs/namespaces/foo/refs/heads/master` is
58+
omitted from the advertisements. If `uploadpack.allowRefInWant` is set,
59+
`upload-pack` will treat `want-ref refs/heads/master` in a protocol v2
60+
`fetch` command as if `refs/heads/master` was unknown. Note, however, that
61+
`receive-pack` will still advertise the object id `refs/heads/master` is
62+
pointing to, but will conceil the name of the ref. In order to match refs
63+
before stripping, add a `^` in front of the ref name. If you combine `!` and
64+
`^`, `!` must be specified first.
6265
+
6366
Even if you hide refs, a client may still be able to steal the target
6467
objects via the techniques described in the "SECURITY" section of the

0 commit comments

Comments
 (0)