git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/7] Documentation: do not use regexp in refspec descriptions

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2008, 05:35 UTC
Message-ID
<7v7i7pba2x.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1225311945-17100-2-git-send-email-mail@cup.kalibalik.dk>
Anders Melchiorsen <mail@cup.kalibalik.dk> writes:
Show 5 quoted lines
> The refspec format description was a mix of regexp and BNF, making it
> very difficult to read.
>
> The syntax is now easier to read, though wrong: all parts of the
> refspec are actually optional.

It probably is easier to read, but strictly speaking it is not wrong. The two parts, <src> and <dst>, _always_ exist, even though either or both of them can be an empty string.

Show 12 quoted lines
> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
> index 6150b1b..df99c0b 100644
> --- a/Documentation/git-push.txt
> +++ b/Documentation/git-push.txt
> @@ -32,7 +32,7 @@ OPTIONS
>  
>  <refspec>...::
>  	The canonical format of a <refspec> parameter is
> -	`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
> +	`[+]<src>:<dst>`; that is, an optional plus `{plus}`, followed
>  	by the source ref, followed by a colon `:`, followed by
>  	the destination ref.

I am wondering if it would be clearer and easier to understand if we just said:

  	The canonical format of a <refspec> parameter is
	an optional plus `{plus}`, followed by the source ref,
        followed by a colon `:`, followed by the destination ref.
	Find various forms of refspecs in examples section.
Previous: Anders MelchiorsenNext: Anders Melchiorsen
Message 12 of 15 in “Some updates to refspec documentation”
  1. Anders MelchiorsenOct 29, 2008
  2. 1/7 Documentation: do not use regexp in refspec descriptionsAnders Melchiorsen, Oct 29, 2008
  3. 2/7 Documentation: git push repository can also be a remoteAnders Melchiorsen, Oct 29, 2008
  4. 3/7 Documentation: rework SHA1 description in git pushAnders Melchiorsen, Oct 29, 2008
  5. 4/7 Documentation: remove a redundant elaborationAnders Melchiorsen, Oct 29, 2008
  6. 5/7 Documentation: elaborate on pushing tagsAnders Melchiorsen, Oct 29, 2008
  7. 6/7 Documentation: mention branches rather than headsAnders Melchiorsen, Oct 29, 2008
  8. 7/7 Documentation: avoid using undefined parametersAnders Melchiorsen, Oct 29, 2008
  9. Daniel BarkalowOct 29, 2008
  10. Junio C HamanoOct 31, 2008
  11. Anders MelchiorsenNov 2, 2008
  12. Junio C HamanoOct 31, 2008
  13. Anders MelchiorsenNov 2, 2008
  14. Anders MelchiorsenOct 29, 2008
  15. Anders MelchiorsenOct 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.