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

[PATCH v3 6/6] doc lint: check that synopsis manpages have synopsis inlines

From
Jean-Noël Avila via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 11, 2025, 20:53 UTC
Message-ID
<8ec969fe4bd0efde5c8cbb1717c1159e6a51fd78.1754945601.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1945.v3.git.1754945600.gitgitgadget@gmail.com>
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

When switching manpages to the synopsis style, the description lists of options need to be switched to inline synopsis for proper formatting. This is done by enclosing the option name in double backticks, e.g. `--option`.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 Documentation/git-checkout.adoc             |  2 +-
 Documentation/git-refs.adoc                 | 20 ++++++++++----------
 Documentation/lint-documentation-style.perl |  6 ++++++
 3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc
index 40e02cfd6562..ff1cb29bc1f8 100644
--- a/Documentation/git-checkout.adoc
+++ b/Documentation/git-checkout.adoc
@@ -334,7 +334,7 @@ include::diff-context-options.adoc[]
 	separated with _NUL_ character and all other characters are taken
 	literally (including newlines and quotes).
 
-<branch>::
+`<branch>`::
 	Branch to checkout; if it refers to a branch (i.e., a name that,
 	when prepended with "refs/heads/", is a valid ref), then that
 	branch is checked out. Otherwise, if it refers to a valid
diff --git a/Documentation/git-refs.adoc b/Documentation/git-refs.adoc
index 4d6dc994f92e..5d26de8acb22 100644
--- a/Documentation/git-refs.adoc
+++ b/Documentation/git-refs.adoc
@@ -20,41 +20,41 @@ This command provides low-level access to refs.
 COMMANDS
 --------
 
-migrate::
+`migrate`::
 	Migrate ref store between different formats.
 
-verify::
+`verify`::
 	Verify reference database consistency.
 
 OPTIONS
 -------
 
-The following options are specific to 'git refs migrate':
+The following options are specific to `git refs migrate`:
 
---ref-format=<format>::
+`--ref-format=<format>`::
 	The ref format to migrate the ref store to. Can be one of:
 +
 include::ref-storage-format.adoc[]
 
---dry-run::
+`--dry-run`::
 	Perform the migration, but do not modify the repository. The migrated
 	refs will be written into a separate directory that can be inspected
 	separately. The name of the directory will be reported on stdout. This
 	can be used to double check that the migration works as expected before
 	performing the actual migration.
 
---reflog::
---no-reflog::
+`--reflog`::
+`--no-reflog`::
 	Choose between migrating the reflog data to the new backend,
 	and discarding them.  The default is "--reflog", to migrate.
 
-The following options are specific to 'git refs verify':
+The following options are specific to `git refs verify`:
 
---strict::
+`--strict`::
 	Enable stricter error checking. This will cause warnings to be
 	reported as errors. See linkgit:git-fsck[1].
 
---verbose::
+`--verbose`::
 	When verifying the reference database consistency, be chatty.
 
 KNOWN LIMITATIONS
diff --git a/Documentation/lint-documentation-style.perl b/Documentation/lint-documentation-style.perl
index 11321a151bca..d7ab7322939e 100755
--- a/Documentation/lint-documentation-style.perl
+++ b/Documentation/lint-documentation-style.perl
@@ -21,6 +21,12 @@ while (my $line = <>) {
 	if ($line =~ /^`?--\[no-\][a-z0-9-]+.*(::|;;)$/) {
 		report($line, "definition list item with a `--[no-]` parameter");
 	}
+	if ($line =~ /^\[synopsis\]$/) {
+		$synopsis_style = 1;
+	}
+	if (($line =~ /^(-[-a-z].*|<[-a-z0-9]+>(\.{3})?)(::|;;)$/) && ($synopsis_style)) {
+			report($line, "synopsis style and definition list item not backquoted");
+	}
 }
 
 
-- 
gitgitgadget
Previous: Jean-Noël Avila via GitGitGadgetNext: Junio C Hamano
Message 26 of 28 in “Introduce more doc linting”
  1. 0/6 Introduce more doc lintingJean-Noël Avila via GitGitGadget, Aug 5, 2025
  2. 1/6 doc: test linkgit macros for well-formednessJean-Noël Avila via GitGitGadget, Aug 5, 2025
  3. 2/6 doc: check well-formedness of delimited sectionsJean-Noël Avila via GitGitGadget, Aug 5, 2025
  4. 3/6 doc: check for absence of multiple terms in each entry of desc listJean-Noël Avila via GitGitGadget, Aug 5, 2025
  5. 4/6 doc: check for absence of the form --[no-]parameterJean-Noël Avila via GitGitGadget, Aug 5, 2025
  6. 5/6 doc:git-for-each-ref: fix styling and typosJean-Noël Avila via GitGitGadget, Aug 5, 2025
  7. 6/6 doc lint: check that synopsis manpages have synopsis inlinesJean-Noël Avila via GitGitGadget, Aug 5, 2025
  8. Junio C HamanoAug 5, 2025
  9. 0/6 Introduce more doc lintingJean-Noël Avila via GitGitGadget, Aug 5, 2025
  10. 1/6 doc: test linkgit macros for well-formednessJean-Noël Avila via GitGitGadget, Aug 5, 2025
  11. 2/6 doc: check well-formedness of delimited sectionsJean-Noël Avila via GitGitGadget, Aug 5, 2025
  12. 3/6 doc: check for absence of multiple terms in each entry of desc listJean-Noël Avila via GitGitGadget, Aug 5, 2025
  13. Ramsay JonesAug 5, 2025
  14. Jean-Noël AVILAAug 8, 2025
  15. Collin FunkAug 6, 2025
  16. Jean-Noël AVILAAug 8, 2025
  17. 4/6 doc: check for absence of the form --[no-]parameterJean-Noël Avila via GitGitGadget, Aug 5, 2025
  18. 5/6 doc:git-for-each-ref: fix styling and typosJean-Noël Avila via GitGitGadget, Aug 5, 2025
  19. 6/6 doc lint: check that synopsis manpages have synopsis inlinesJean-Noël Avila via GitGitGadget, Aug 5, 2025
  20. 0/6 Introduce more doc lintingJean-Noël Avila via GitGitGadget, Aug 11, 2025
  21. 1/6 doc: test linkgit macros for well-formednessJean-Noël Avila via GitGitGadget, Aug 11, 2025
  22. 2/6 doc: check well-formedness of delimited sectionsJean-Noël Avila via GitGitGadget, Aug 11, 2025
  23. 3/6 doc: check for absence of multiple terms in each entry of desc listJean-Noël Avila via GitGitGadget, Aug 11, 2025
  24. 4/6 doc: check for absence of the form --[no-]parameterJean-Noël Avila via GitGitGadget, Aug 11, 2025
  25. 5/6 doc:git-for-each-ref: fix styling and typosJean-Noël Avila via GitGitGadget, Aug 11, 2025
  26. 6/6 doc lint: check that synopsis manpages have synopsis inlinesJean-Noël Avila via GitGitGadget, Aug 11, 2025
  27. Junio C HamanoAug 14, 2025
  28. Jean-Noël AVILAAug 14, 2025

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.