Skip to contentSkip to conversation

fetch doc: escape asterisk in --tags paragraph

PATCH In review Ramkumar Ramachandra 2 participants 4 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch doc: escape asterisk in --tags paragraph

Currently, the paragraph corresponding to the --tags option in git-fetch(1) looks like:

-t, --tags
This is a short-hand for giving "refs/tags/:refs/tags/" refspec
^^^^^^^^^^^ this is in bold

This happens because the corresponding text in fetch-options.txt is "refs/tags/*:refs/tags/*"; asciidoc renders the text between the two asterisks in bold. Escape the first asterisk, correcting the text.

---
Candidate for maint?

 Documentation/fetch-options.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/fetch-options.txt +1 -1
index 9cb6496..5f68149 100644
@@ -61,7 +61,7 @@ endif::git-pull[]
 ifndef::git-pull[]
 -t::
 --tags::
-	This is a short-hand for giving "refs/tags/*:refs/tags/*"
+	This is a short-hand for giving "refs/tags/\*:refs/tags/*"
 	refspec from the command line, to ask all tags to be fetched
 	and stored locally.  Because this acts as an explicit
 	refspec, the default refspecs (configured with the
Signature · 1 line
1.8.3.20.g7940bce.dirty
#1 lore raw
Quoted 8 lines · Ramkumar Ramachandra

Currently, the paragraph corresponding to the --tags option in git-fetch(1) looks like:

-t, --tags
This is a short-hand for giving "refs/tags/:refs/tags/" refspec
^^^^^^^^^^^ this is in bold

Quoted 7 lines

This happens because the corresponding text in fetch-options.txt is "refs/tags/*:refs/tags/*"; asciidoc renders the text between the two asterisks in bold. Escape the first asterisk, correcting the text.

---
Candidate for maint?

The issue certainly is real and needs a fix for maint. Your solution I am not sure about.

  $ git grep '\\\*' -- Documentation/\*.txt

shows only two meaningful hits (git-rm.txt and git-svn.txt); everybody else uses

$ git grep '{asterisk}' -- Documentation/\*.txt

and the one you spotted in fetch-options.txt is very similar to the one appears in git-pull.txt, I think.

Quoted 16 lines
 Documentation/fetch-options.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/fetch-options.txt +1 -1
index 9cb6496..5f68149 100644
@@ -61,7 +61,7 @@ endif::git-pull[]
 ifndef::git-pull[]
 -t::
 --tags::
-	This is a short-hand for giving "refs/tags/*:refs/tags/*"
+	This is a short-hand for giving "refs/tags/\*:refs/tags/*"
 	refspec from the command line, to ask all tags to be fetched
 	and stored locally.  Because this acts as an explicit
 	refspec, the default refspecs (configured with the
#2 lore raw
Quoted 23 lines · Junio C Hamano
Quoted 8 lines · Ramkumar Ramachandra

Currently, the paragraph corresponding to the --tags option in git-fetch(1) looks like:

-t, --tags
This is a short-hand for giving "refs/tags/:refs/tags/" refspec
^^^^^^^^^^^ this is in bold

Quoted 7 lines

This happens because the corresponding text in fetch-options.txt is "refs/tags/*:refs/tags/*"; asciidoc renders the text between the two asterisks in bold. Escape the first asterisk, correcting the text.

---
Candidate for maint?

The issue certainly is real and needs a fix for maint. Your solution I am not sure about.

  $ git grep '\\\*' -- Documentation/\*.txt
Quoted 7 lines

shows only two meaningful hits (git-rm.txt and git-svn.txt); everybody else uses

$ git grep '{asterisk}' -- Documentation/\*.txt

and the one you spotted in fetch-options.txt is very similar to the one appears in git-pull.txt, I think.

How about this?

-- >8 --
Subject: fetch-options.txt: prevent wildcard refspec from getting misformatted

When explaining the "--tags" option as an equivalent to giving an explicit "refs/tags/*:refs/tags/*" refspec, the two asterisks were misinterpreted by AsciiDoc as a request to typeset the string segment between them in bold.

We could fix it in two ways. We can replace them with {asterisk}s while keeping the string as body text, or we can mark it as a literal string by using the backquotes around it.

Let's do the latter, as it is teaching the user an "exactly as typed" alternative.

---
 Documentation/fetch-options.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/fetch-options.txt +1 -1
index 6e98bdf..c87bf39 100644
@@ -57,7 +57,7 @@ endif::git-pull[]
 ifndef::git-pull[]
 -t::
 --tags::
-	This is a short-hand for giving "refs/tags/*:refs/tags/*"
+	This is a short-hand for giving `refs/tags/*:refs/tags/*`
 	refspec from the command line, to ask all tags to be fetched
 	and stored locally.  Because this acts as an explicit
 	refspec, the default refspecs (configured with the