# [PATCH] State correct usage of backticks for options in man pages in the coding guidelines

3 messages from 2013-11-13 to 2013-11-13. Participants: Jason St. John, Ramkumar Ramachandra, Junio C Hamano.
Thread: https://gitlist.dev/t/35327

## Jason St. John, 2013-11-13 04:21

Subject: [PATCH] State correct usage of backticks for options in man pages in the coding guidelines
Message-ID: <1384316501-27965-1-git-send-email-jstjohn@purdue.edu>
URL: https://gitlist.dev/e/1384316501-27965-1-git-send-email-jstjohn%40purdue.edu

```
The man pages contain inconsistent usage of backticks vs. single quotes
around options and commands that are in paragraphs. This commit states
that backticks should always be used around options and commands.

This commit also states that "--" and friends should be left unescaped
(e.g. use `--pretty=oneline` instead of `\--pretty=oneline`).

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
---
This was discussed here:
http://marc.info/?l=git&m=138419319223845&w=2
http://marc.info/?l=git&m=138424552300662&w=2


 Documentation/CodingGuidelines | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index a600e35..b335d48 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -260,9 +260,11 @@ Writing Documentation:
 
  Every user-visible change should be reflected in the documentation.
  The same general rule as for code applies -- imitate the existing
- conventions.  A few commented examples follow to provide reference
- when writing or modifying command usage strings and synopsis sections
- in the manual pages:
+ conventions.
+
+ A few commented examples follow to provide reference when writing or
+ modifying command usage strings and synopsis sections in the manual
+ pages:
 
  Placeholders are spelled in lowercase and enclosed in angle brackets:
    <file>
@@ -312,3 +314,17 @@ Writing Documentation:
    Use 'git' (all lowercase) when talking about commands i.e. something
    the user would type into a shell and use 'Git' (uppercase first letter)
    when talking about the version control system and its properties.
+
+ A few commented examples follow to provide reference when writing or
+ modifying paragraphs or option/command explanations that contain options
+ or commands:
+
+ Backticks are used around options or commands:
+   `--pretty=oneline`
+   `git rev-list`
+
+ Options or commands should use unescaped AsciiDoc:
+   Correct:
+      `--pretty=oneline`
+   Incorrect:
+      `\--pretty=oneline`
-- 
1.8.4.2

```

## Ramkumar Ramachandra, 2013-11-13 10:04

Subject: Re: [PATCH] State correct usage of backticks for options in man pages in the coding guidelines
Message-ID: <CALkWK0nD4aYQYVdfP=Dbb+XhYOHz=Ffvb_EzdgyYU86yXcXdjg@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0nD4aYQYVdfP%3DDbb%2BXhYOHz%3DFfvb_EzdgyYU86yXcXdjg%40mail.gmail.com
In-Reply-To: <1384316501-27965-1-git-send-email-jstjohn@purdue.edu>

```
Jason St. John wrote:
> + Backticks are used around options or commands:
> +   `--pretty=oneline`
> +   `git rev-list`

You might want to include configuration variables like
`remote.pushdefault` here.

```

## Junio C Hamano, 2013-11-13 17:21

Subject: Re: [PATCH] State correct usage of backticks for options in man pages in the coding guidelines
Message-ID: <xmqq61rwfc9p.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqq61rwfc9p.fsf%40gitster.dls.corp.google.com
In-Reply-To: <1384316501-27965-1-git-send-email-jstjohn@purdue.edu>

```
"Jason St. John" <jstjohn@purdue.edu> writes:

> + Backticks are used around options or commands:
> +   `--pretty=oneline`
> +   `git rev-list`

I'd prefer to see the objective stated before a particular means to
achieve it.  I.e. not "backticks around options and commands", but
"literal examples (e.g. use of command line options, command names
and configuration variables) are typeset monospaced, and if you can
use `backticks around word phrase`, do so.".

> + Options or commands should use unescaped AsciiDoc:
> +   Correct:
> +      `--pretty=oneline`
> +   Incorrect:
> +      `\--pretty=oneline`

I think it is wrong to single out "options or commands" here, and
also it is wrong to say "unescaped".  The "unescaped" is merely a
consequence of combination between:

http://www.methods.co.nz/asciidoc/asciidoc.css-embedded.html#_text_formatting

    Word phrases `enclosed in backtick characters` (grave accents)
    are also rendered in a monospaced font but in this case the
    enclosed text is rendered literally and is not subject to
    further expansion.

and the use of `backticks` to achieve "literal examples are typeset
monospaced" rule.

If some place in the documentation needs to typeset a command use
example with inline substitutions, it is fine to use +monospaced and
inline substituted text+ instead of `monospaced literal text`, and
with the former, we do need to quote the part we do not want to get
substituted.

Thanks.

```
