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

[PATCH 1/6] doc: test linkgit macros for well-formedness

From
Jean-Noël Avila via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 5, 2025, 13:03 UTC
Message-ID
<e79bd6a67ef2ea7247359b2449c7c313c7fa9922.1754399033.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1945.git.1754399033.gitgitgadget@gmail.com>
From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>

Some readers of man pages have reported that they found malformed linkgit macros in the documentation (absence or bad spelling).

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
---
 Documentation/gitweb.conf.adoc  | 2 +-
 Documentation/lint-gitlink.perl | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/Documentation/gitweb.conf.adoc b/Documentation/gitweb.conf.adoc
index 1348e9b12504..64bebb811c97 100644
--- a/Documentation/gitweb.conf.adoc
+++ b/Documentation/gitweb.conf.adoc
@@ -178,7 +178,7 @@ $export_ok::
 	Show repository only if this file exists (in repository).  Only
 	effective if this variable evaluates to true.  Can be set when
 	building gitweb by setting `GITWEB_EXPORT_OK`.  This path is
-	relative to `GIT_DIR`.  git-daemon[1] uses 'git-daemon-export-ok',
+	relative to `GIT_DIR`.  linkgit:git-daemon[1] uses 'git-daemon-export-ok',
 	unless started with `--export-all`.  By default this variable is
 	not set, which means that this feature is turned off.
 
diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
index aea564dad7ed..f183a18df284 100755
--- a/Documentation/lint-gitlink.perl
+++ b/Documentation/lint-gitlink.perl
@@ -41,6 +41,13 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
 @ARGV = $to_check;
 while (<>) {
 	my $line = $_;
+	while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
+	    my $pos = pos $line;
+	    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
+		if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
+			report($pos, $line, $target, "linkgit: macro expected");
+		}
+	}
 	while ($line =~ m/linkgit:((.*?)\[(\d)\])/g) {
 		my $pos = pos $line;
 		my ($target, $page, $section) = ($1, $2, $3);
-- 
gitgitgadget
Previous: Jean-Noël Avila via GitGitGadgetNext: Jean-Noël Avila via GitGitGadget
Message 2 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.