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 <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2009-01-25 22:25:20 -08:00
parent 5c415311f7
commit 7a0d911f11
2 changed files with 9 additions and 9 deletions

View File

@ -33,10 +33,11 @@ OPTIONS
of a remote (see the section <<REMOTES,REMOTES>> below). of a remote (see the section <<REMOTES,REMOTES>> below).
<refspec>...:: <refspec>...::
The canonical format of a <refspec> parameter is The format of a <refspec> parameter is an optional plus
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed `{plus}`, followed by the source ref <src>, followed
by the source ref, followed by a colon `:`, followed by by a colon `:`, followed by the destination ref <dst>.
the destination ref. It is used to specify with what <src> object the <dst> ref
in the remote repository is to be updated.
+ +
The <src> side represents the source branch (or arbitrary The <src> side represents the source branch (or arbitrary
"SHA1 expression", such as `master~4` (four parents before the "SHA1 expression", such as `master~4` (four parents before the

View File

@ -5,15 +5,14 @@
of a remote (see the section <<REMOTES,REMOTES>> below). of a remote (see the section <<REMOTES,REMOTES>> below).
<refspec>:: <refspec>::
The canonical format of a <refspec> parameter is The format of a <refspec> parameter is an optional plus
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed `{plus}`, followed by the source ref <src>, followed
by the source ref, followed by a colon `:`, followed by by a colon `:`, followed by the destination ref <dst>.
the destination ref.
+ +
The remote ref that matches <src> The remote ref that matches <src>
is fetched, and if <dst> is not empty string, the local is fetched, and if <dst> is not empty string, the local
ref that matches it is fast forwarded using <src>. ref that matches it is fast forwarded using <src>.
Again, if the optional plus `+` is used, the local ref If the optional plus `+` is used, the local ref
is updated even if it does not result in a fast forward is updated even if it does not result in a fast forward
update. update.
+ +