summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Noël Avila <jn.avila@free.fr>2026-01-21 14:27:05 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-21 08:26:00 -0800
commit46933bf1825eb436b8e3ae6aba067344e0a8bfae (patch)
treefac6f750d11be955ee55da4a9cabc108d0fcf8c7
parentad228c24df15e96f98737a9751a455e278b62fcb (diff)
downloadgit-46933bf1825eb436b8e3ae6aba067344e0a8bfae.tar.xz
lint-gitlink: preemptively ignore all /ifn?def|endif/ macros
Instead of testing if the macro name is ifn?def:: as if it were a inline macro, it is faster and safer to just ignore such block macro lines before hand. Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xDocumentation/lint-gitlink.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
index f183a18df2..a92e887b4c 100755
--- a/Documentation/lint-gitlink.perl
+++ b/Documentation/lint-gitlink.perl
@@ -41,10 +41,11 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
@ARGV = $to_check;
while (<>) {
my $line = $_;
+ next if $line =~ /^\s*(ifn?def|endif)::/;
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::" ) {
+ if ( $macro ne "linkgit:" ) {
report($pos, $line, $target, "linkgit: macro expected");
}
}