Skip to content

Commit 0dbd305

Browse files
Patapatapongitster
authored andcommitted
doc/CodingGuidelines: URLs and paths as monospace
The current documentation uses both quotes (italics) and backquotes (monospace) to render URLs and pathnames, which is inconsistent. Document a best practice in CodingGuidelines to help reduce inconsistencies in the future. We set the best practice to using backquotes, since: * It is already an established practice. For exemple: $ git grep "'[^']/*[^']'" | wc -l 206 $ git grep '`[^`]/*[^`]`' | wc -l 690 There are false positives on both sides, but after a cursory look at the output of both, it doesn't seem the false positive rate is really higher in the second case. At least, this shows that the existing documentation uses inconsistent formatting, and that it would be good to do something about it. * It may be debatable whether path names need to be typed in monospace but having them in italics is really unusual. Signed-off-by: Corentin BOMPARD <[email protected]> Signed-off-by: Nathan BERBEZIER <[email protected]> Signed-off-by: Pablo CHABANNE <[email protected]> Signed-off-by: Matthieu MOY <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aeb582a commit 0dbd305

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Documentation/CodingGuidelines

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,14 @@ Writing Documentation:
580580
or commands:
581581

582582
Literal examples (e.g. use of command-line options, command names,
583-
branch names, configuration and environment variables) must be
584-
typeset in monospace (i.e. wrapped with backticks):
583+
branch names, URLs, pathnames (files and directories), configuration and
584+
environment variables) must be typeset in monospace (i.e. wrapped with
585+
backticks):
585586
`--pretty=oneline`
586587
`git rev-list`
587588
`remote.pushDefault`
589+
`http://git.example.com`
590+
`.git/config`
588591
`GIT_DIR`
589592
`HEAD`
590593

0 commit comments

Comments
 (0)