Skip to content

Commit 41f5b21

Browse files
Tom Russellogitster
authored andcommitted
doc: clearer rule about formatting literals
Make the guideline text that we want for our documentation clearer. Signed-off-by: Tom Russello <[email protected]> Signed-off-by: Erwan Mathoniere <[email protected]> Signed-off-by: Samuel Groot <[email protected]> Signed-off-by: Matthieu Moy <[email protected]> Reviewed-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b65a8d commit 41f5b21

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Documentation/CodingGuidelines

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,19 @@ Writing Documentation:
526526
modifying paragraphs or option/command explanations that contain options
527527
or commands:
528528

529-
Literal examples (e.g. use of command-line options, command names, and
530-
configuration variables) are typeset in monospace, and if you can use
531-
`backticks around word phrases`, do so.
529+
Literal examples (e.g. use of command-line options, command names,
530+
configuration and environment variables) must be typeset in monospace (i.e.
531+
wrapped with backticks):
532532
`--pretty=oneline`
533533
`git rev-list`
534534
`remote.pushDefault`
535+
`GIT_DIR`
536+
537+
An environment variable must be prefixed with "$" only when referring to its
538+
value and not when referring to the variable itself, in this case there is
539+
nothing to add except the backticks:
540+
`GIT_DIR` is specified
541+
`$GIT_DIR/hooks/pre-receive`
535542

536543
Word phrases enclosed in `backtick characters` are rendered literally
537544
and will not be further expanded. The use of `backticks` to achieve the

0 commit comments

Comments
 (0)