All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lint-gitlink: don't use empty lower bound in .{0,8}
@ 2026-09-07 18:48 Tuomas Ahola
  2026-09-08  3:37 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Tuomas Ahola @ 2026-09-07 18:48 UTC (permalink / raw)
  To: git; +Cc: Tuomas Ahola

The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand
for {0,n}.  That makes it too new an introduction for Git which
targets Perl 5.26.0.

Even though Documentation/lint-gitlink.perl is a development helper
script, let's stick to the general Perl version requirement for
consistency, and use an explicit zero in .{0,8}.

Signed-off-by: Tuomas Ahola <taahol@utu.fi>
---
 Documentation/lint-gitlink.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
index a92e887b4c..6a87633dd4 100755
--- a/Documentation/lint-gitlink.perl
+++ b/Documentation/lint-gitlink.perl
@@ -42,7 +42,7 @@ sub report {
 while (<>) {
 	my $line = $_;
 	next if $line =~ /^\s*(ifn?def|endif)::/;
-	while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
+	while ($line =~ m/(.{0,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
 	    my $pos = pos $line;
 	    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
 		if ( $macro ne "linkgit:" ) {

base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
-- 
ta/lint-gitlink-perl-regex-nit


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] lint-gitlink: don't use empty lower bound in .{0,8}
  2026-09-07 18:48 [PATCH] lint-gitlink: don't use empty lower bound in .{0,8} Tuomas Ahola
@ 2026-09-08  3:37 ` Junio C Hamano
  2026-09-08  6:43   ` Tuomas Ahola
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2026-09-08  3:37 UTC (permalink / raw)
  To: Tuomas Ahola; +Cc: git

Tuomas Ahola <taahol@utu.fi> writes:

> The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand
> for {0,n}.  That makes it too new an introduction for Git which
> targets Perl 5.26.0.
>
> Even though Documentation/lint-gitlink.perl is a development helper
> script, let's stick to the general Perl version requirement for
> consistency, and use an explicit zero in .{0,8}.

I am curious how you found this.

I somehow find it unlikely that you were sticking to Perl 5.26, ran
"make -C Documentation lint-docs" and saw your tad old Perl complain
for syntax too new.

Perl 5.26 is from May 2017 while Perl 5.34 is from May 2021 if
https://cpan.org/src/ is to be believed.  

Will queue.  Thanks.


> Signed-off-by: Tuomas Ahola <taahol@utu.fi>
> ---
>  Documentation/lint-gitlink.perl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/lint-gitlink.perl b/Documentation/lint-gitlink.perl
> index a92e887b4c..6a87633dd4 100755
> --- a/Documentation/lint-gitlink.perl
> +++ b/Documentation/lint-gitlink.perl
> @@ -42,7 +42,7 @@ sub report {
>  while (<>) {
>  	my $line = $_;
>  	next if $line =~ /^\s*(ifn?def|endif)::/;
> -	while ($line =~ m/(.{,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
> +	while ($line =~ m/(.{0,8})((git[-a-z]+|scalar)\[(\d)*\])/g) {
>  	    my $pos = pos $line;
>  	    my ($macro, $target, $page, $section) = ($1, $2, $3, $4);
>  		if ( $macro ne "linkgit:" ) {
>
> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lint-gitlink: don't use empty lower bound in .{0,8}
  2026-09-08  3:37 ` Junio C Hamano
@ 2026-09-08  6:43   ` Tuomas Ahola
  0 siblings, 0 replies; 3+ messages in thread
From: Tuomas Ahola @ 2026-09-08  6:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <gitster@pobox.com> wrote:

> Tuomas Ahola <taahol@utu.fi> writes:
> 
> > The regex quantifier {,n} was added in Perl 5.34.0 as a shorthand
> > for {0,n}.  That makes it too new an introduction for Git which
> > targets Perl 5.26.0.
> >
> > Even though Documentation/lint-gitlink.perl is a development helper
> > script, let's stick to the general Perl version requirement for
> > consistency, and use an explicit zero in .{0,8}.
> 
> I am curious how you found this.
> 
> I somehow find it unlikely that you were sticking to Perl 5.26, ran
> "make -C Documentation lint-docs" and saw your tad old Perl complain
> for syntax too new.

Well, that's what happened (although my Perl wasn't exactly 5.26).

> 
> Perl 5.26 is from May 2017 while Perl 5.34 is from May 2021 if
> https://cpan.org/src/ is to be believed.  
> 
> Will queue.  Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-08  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 18:48 [PATCH] lint-gitlink: don't use empty lower bound in .{0,8} Tuomas Ahola
2026-09-08  3:37 ` Junio C Hamano
2026-09-08  6:43   ` Tuomas Ahola

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.