{"thread":{"id":"66287","subject":"[PATCH] lint-gitlink: don't use empty lower bound in .{0,8}","startedAt":"2026-09-07T18:49:12Z","lastAt":"2026-09-08T06:43:11Z","messageCount":3,"participants":["Tuomas Ahola","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"552154","messageId":"20260907184858.13475-1-taahol@utu.fi","threadId":"66287","inReplyTo":null,"subject":"[PATCH] lint-gitlink: don't use empty lower bound in .{0,8}","fromName":"Tuomas Ahola","fromEmail":"taahol@utu.fi","sentAt":"2026-09-07T18:48:58Z","receivedAt":"2026-09-07T18:49:12Z","isPatch":true,"body":"The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand\nfor {0,n}.  That makes it too new an introduction for Git which\ntargets Perl 5.26.0.\n\nEven though Documentation/lint-gitlink.perl is a development helper\nscript, let's stick to the general Perl version requirement for\nconsistency, and use an explicit zero in .{0,8}.\n\nSigned-off-by: Tuomas Ahola <taahol@utu.fi>\n---\n Documentation/lint-gitlink.perl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl\nindex a92e887b4c..6a87633dd4 100755\n--- a/Documentation/lint-gitlink.perl\n+++ b/Documentation/lint-gitlink.perl\n@@ -42,7 +42,7 @@ sub report {\n while (<>) {\n \tmy $line = $_;\n \tnext if $line =~ /^\\s*(ifn?def|endif)::/;\n-\twhile ($line =~ m/(.{,8})((git[-a-z]+|scalar)\\[(\\d)*\\])/g) {\n+\twhile ($line =~ m/(.{0,8})((git[-a-z]+|scalar)\\[(\\d)*\\])/g) {\n \t    my $pos = pos $line;\n \t    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);\n \t\tif ( $macro ne \"linkgit:\" ) {\n\nbase-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n-- \nta/lint-gitlink-perl-regex-nit\n\n"},{"id":"552178","messageId":"xmqqo6e8za5e.fsf@gitster.g","threadId":"66287","inReplyTo":"20260907184858.13475-1-taahol@utu.fi","subject":"Re: [PATCH] lint-gitlink: don't use empty lower bound in .{0,8}","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-09-08T03:37:01Z","receivedAt":"2026-09-08T03:37:07Z","isPatch":true,"body":"Tuomas Ahola <taahol@utu.fi> writes:\n\n> The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand\n> for {0,n}.  That makes it too new an introduction for Git which\n> targets Perl 5.26.0.\n>\n> Even though Documentation/lint-gitlink.perl is a development helper\n> script, let's stick to the general Perl version requirement for\n> consistency, and use an explicit zero in .{0,8}.\n\nI am curious how you found this.\n\nI somehow find it unlikely that you were sticking to Perl 5.26, ran\n\"make -C Documentation lint-docs\" and saw your tad old Perl complain\nfor syntax too new.\n\nPerl 5.26 is from May 2017 while Perl 5.34 is from May 2021 if\nhttps://cpan.org/src/ is to be believed.  \n\nWill queue.  Thanks.\n\n\n> Signed-off-by: Tuomas Ahola <taahol@utu.fi>\n> ---\n>  Documentation/lint-gitlink.perl | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl\n> index a92e887b4c..6a87633dd4 100755\n> --- a/Documentation/lint-gitlink.perl\n> +++ b/Documentation/lint-gitlink.perl\n> @@ -42,7 +42,7 @@ sub report {\n>  while (<>) {\n>  \tmy $line = $_;\n>  \tnext if $line =~ /^\\s*(ifn?def|endif)::/;\n> -\twhile ($line =~ m/(.{,8})((git[-a-z]+|scalar)\\[(\\d)*\\])/g) {\n> +\twhile ($line =~ m/(.{0,8})((git[-a-z]+|scalar)\\[(\\d)*\\])/g) {\n>  \t    my $pos = pos $line;\n>  \t    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);\n>  \t\tif ( $macro ne \"linkgit:\" ) {\n>\n> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n"},{"id":"552184","messageId":"20260908064305.PIgoB%taahol@utu.fi","threadId":"66287","inReplyTo":"xmqqo6e8za5e.fsf@gitster.g","subject":"Re: [PATCH] lint-gitlink: don't use empty lower bound in .{0,8}","fromName":"Tuomas Ahola","fromEmail":"taahol@utu.fi","sentAt":"2026-09-08T06:43:05Z","receivedAt":"2026-09-08T06:43:11Z","isPatch":true,"body":"Junio C Hamano <gitster@pobox.com> wrote:\n\n> Tuomas Ahola <taahol@utu.fi> writes:\n> \n> > The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand\n> > for {0,n}.  That makes it too new an introduction for Git which\n> > targets Perl 5.26.0.\n> >\n> > Even though Documentation/lint-gitlink.perl is a development helper\n> > script, let's stick to the general Perl version requirement for\n> > consistency, and use an explicit zero in .{0,8}.\n> \n> I am curious how you found this.\n> \n> I somehow find it unlikely that you were sticking to Perl 5.26, ran\n> \"make -C Documentation lint-docs\" and saw your tad old Perl complain\n> for syntax too new.\n\nWell, that's what happened (although my Perl wasn't exactly 5.26).\n\n> \n> Perl 5.26 is from May 2017 while Perl 5.34 is from May 2021 if\n> https://cpan.org/src/ is to be believed.  \n> \n> Will queue.  Thanks.\n"}]}