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>
Jean-Noël Avila committed
Jan 21, 2026 at 14:27 UTC
46933bf1825eb436b8e3ae6aba067344e0a8bfae
1 file changed
+2
-1
Documentation/lint-gitlink.perl
+2
-1
@@ -41,10 +41,11 @@ die "BUG: No list of valid linkgit:* files given" unless @ARGV;
41
@ARGV = $to_check;
42
while (<>) {
43
my $line = $_;
44
+ next if $line =~ /^\s*(ifn?def|endif)::/;
45
while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
46
my $pos = pos $line;
47
my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
47
- if ( $macro ne "linkgit:" && $macro !~ "ifn?def::" && $macro ne "endif::" ) {
48
+ if ( $macro ne "linkgit:" ) {
49
report($pos, $line, $target, "linkgit: macro expected");
50
}
51
}