doc: test linkgit macros for well-formedness
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila committed
Aug 11, 2025 at 20:53 UTC
f81a574f59a61dd85ee918f8759a624d33f3539e
2 files changed
+8
-1
Documentation/gitweb.conf.adoc
+1
-1
@@ -178,7 +178,7 @@ $export_ok::
178
Show repository only if this file exists (in repository). Only
179
effective if this variable evaluates to true. Can be set when
180
building gitweb by setting `GITWEB_EXPORT_OK`. This path is
181
- relative to `GIT_DIR`. git-daemon[1] uses 'git-daemon-export-ok',
181
+ relative to `GIT_DIR`. linkgit:git-daemon[1] uses 'git-daemon-export-ok',
182
unless started with `--export-all`. By default this variable is
183
not set, which means that this feature is turned off.
184
Documentation/lint-gitlink.perl
+7
@@ -41,6 +41,13 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
41
@ARGV = $to_check;
42
while (<>) {
43
my $line = $_;
44
+ while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
45
+ my $pos = pos $line;
46
+ my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
47
+ if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
48
+ report($pos, $line, $target, "linkgit: macro expected");
49
+ }
50
+ }
51
while ($line =~ m/linkgit:((.*?)\[(\d)\])/g) {
52
my $pos = pos $line;
53
my ($target, $page, $section) = ($1, $2, $3);