Skip to content

Commit 7a0d911

Browse files
committed
Documentation: simplify refspec format description
The refspec format description was a mix of regexp and BNF, making it very difficult to read. The format was also wrong: it did not show that each part of a refspec is optional in different situations. Rather than having a confusing grammar, just present the format in informal prose. Signed-off-by: Anders Melchiorsen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c41531 commit 7a0d911

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Documentation/git-push.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ OPTIONS
3333
of a remote (see the section <<REMOTES,REMOTES>> below).
3434

3535
<refspec>...::
36-
The canonical format of a <refspec> parameter is
37-
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
38-
by the source ref, followed by a colon `:`, followed by
39-
the destination ref.
36+
The format of a <refspec> parameter is an optional plus
37+
`{plus}`, followed by the source ref <src>, followed
38+
by a colon `:`, followed by the destination ref <dst>.
39+
It is used to specify with what <src> object the <dst> ref
40+
in the remote repository is to be updated.
4041
+
4142
The <src> side represents the source branch (or arbitrary
4243
"SHA1 expression", such as `master~4` (four parents before the

Documentation/pull-fetch-param.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
of a remote (see the section <<REMOTES,REMOTES>> below).
66

77
<refspec>::
8-
The canonical format of a <refspec> parameter is
9-
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
10-
by the source ref, followed by a colon `:`, followed by
11-
the destination ref.
8+
The format of a <refspec> parameter is an optional plus
9+
`{plus}`, followed by the source ref <src>, followed
10+
by a colon `:`, followed by the destination ref <dst>.
1211
+
1312
The remote ref that matches <src>
1413
is fetched, and if <dst> is not empty string, the local
1514
ref that matches it is fast forwarded using <src>.
16-
Again, if the optional plus `+` is used, the local ref
15+
If the optional plus `+` is used, the local ref
1716
is updated even if it does not result in a fast forward
1817
update.
1918
+

0 commit comments

Comments
 (0)