Skip to content

Commit 8ead1bb

Browse files
committed
doc: clarify <src> in refspec syntax
We explicitly avoid saying "ref <src>" when introducing the source side of a refspec, because it can be a fully-spelled hexadecimal object name, and it also can be a pattern that is not quite a "ref". But we are loose when we introduce <dst> and say "ref <dst>", even though it can also be a pattern. Let's omit "ref" also from the destination side. Clarify that <src> can be a ref, a (limited glob) pattern, or an object name. Even though the very original design of refspec expected that '*' was used only at the end (e.g., "refs/heads/*" was expected, but not "refs/heads/*-wip"), the code and its use evolved to handle a single '*' anywhere in the pattern. Update the text to remove the mention of "the same prefix". Anything that matches the pattern are named by such a (limited glob) pattern in <src>. Also put a bit more stress on the fact that we accept only one '*' in the pattern by saying "one and only one `*`". Helped-by: Monika Kairaitytė <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 777489f commit 8ead1bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Documentation/pull-fetch-param.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ endif::git-pull[]
2525
+
2626
The format of a <refspec> parameter is an optional plus
2727
`+`, followed by the source <src>, followed
28-
by a colon `:`, followed by the destination ref <dst>.
28+
by a colon `:`, followed by the destination <dst>.
2929
The colon can be omitted when <dst> is empty. <src> is
30-
typically a ref, but it can also be a fully spelled hex object
30+
typically a ref, or a glob pattern with a single `*` that is used
31+
to match a set of refs, but it can also be a fully spelled hex object
3132
name.
3233
+
3334
A <refspec> may contain a `*` in its <src> to indicate a simple pattern
3435
match. Such a refspec functions like a glob that matches any ref with the
35-
same prefix. A pattern <refspec> must have a `*` in both the <src> and
36+
pattern. A pattern <refspec> must have one and only one `*` in both the <src> and
3637
<dst>. It will map refs to the destination by replacing the `*` with the
3738
contents matched from the source.
3839
+

0 commit comments

Comments
 (0)