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

[PATCH 1/2 v3] doc/CodingGuidelines: URLs and paths as monospace.

From
Corentin BOMPARD <corentin.bompard@etu.univ-lyon1.fr>
Date
Mar 6, 2019, 13:04 UTC
Message-ID
<20190306130446.2193-1-corentin.bompard@etu.univ-lyon1.fr>

The current documentation uses both quotes (italics) and backquotes (monospace) to render URLs and pathnames, which is inconsistant. Document a best practice in CodingGuidelines to help reduce inconsistencies in the futur.

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 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 <corentin.bompard@etu.univ-lyon1.fr>
Signed-off-by: Nathan BERBEZIER <nathan.berbezier@etu.univ-lyon1.fr>
Signed-off-by: Pablo CHABANNE <pablo.chabanne@etu.univ-lyon1.fr>
Signed-off-by: Matthieu MOY <matthieu.moy@univ-lyon1.fr>
---
 Changes: According to Matthieu MOY we added a new guideline in
 Documentation/CodingGuidelines.txt about monospace.
 Documentation/CodingGuidelines | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 857953071..0baff9dbe 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -580,11 +580,14 @@ Writing Documentation:
  or commands:
 
  Literal examples (e.g. use of command-line options, command names,
- branch names, configuration and environment variables) must be
- typeset in monospace (i.e. wrapped with backticks):
+ branch names, URLs, pathnames (files and directories), configuration and
+ environment variables) must be typeset in monospace (i.e. wrapped with 
+ backticks):
    `--pretty=oneline`
    `git rev-list`
    `remote.pushDefault`
+   `http://git.example.com`
+   `.git/config`
    `GIT_DIR`
    `HEAD`
 
-- 
2.21.0-rc0
Next: Corentin BOMPARD
Message 1 of 8 in “doc/CodingGuidelines: URLs and paths as monospace.”
  1. 1/2 doc/CodingGuidelines: URLs and paths as monospace.Corentin BOMPARD, Mar 6, 2019
  2. 2/2 doc: format pathnames and URLs as monospace.Corentin BOMPARD, Mar 6, 2019
  3. Matthieu MoyMar 12, 2019
  4. Eric SunshineMar 12, 2019
  5. Andrei RybakMar 12, 2019
  6. Junio C HamanoMar 13, 2019
  7. Eric SunshineMar 13, 2019
  8. Matthieu MoyMar 13, 2019

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.