mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Janne Grunau <j@jannau.net>
Cc: linux-kernel@vger.kernel.org, "Martin Povišer" <povik+lin@cutebit.org>
Subject: Re: [PATCH] get_maintainer: Extend matched name characters in maintainers_in_file()
Date: Sun, 18 Sep 2022 14:40:40 -0700	[thread overview]
Message-ID: <b683a340c820e7b55f7da047bfe3dd327db8ea5c.camel@perches.com> (raw)
In-Reply-To: <20220918203217.GG4024@jannau.net>

On Sun, 2022-09-18 at 22:32 +0200, Janne Grunau wrote:
> On 2022-09-18 10:03:17 -0700, Joe Perches wrote:
> > On Sat, 2022-09-17 at 07:11 -0700, Joe Perches wrote:
> > > On Fri, 2022-09-16 at 10:47 +0200, Janne Grunau wrote:
> > > > Extend the regexp matching name characters to cover Unicode blocks Latin
> > > > Extended-A and Extended-B.
> > > > Fixes 'scripts/get_maintainer.pl -f' for
> > > > 'Documentation/devicetree/bindings/clock/apple,nco.yaml'.
[]
> > > > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> > > []
> > > > @@ -442,7 +442,7 @@ sub maintainers_in_file {
> > > >  	my $text = do { local($/) ; <$f> };
> > > >  	close($f);
> > > >  
> > > > -	my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
> > > > +	my @poss_addr = $text =~ m$[A-Za-zÀ-ɏ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
> > > 
> > > 	my @poss_addr = $text =~ m$[\p{XPosixAlpha}\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g;
> > 
> > Using variations of \p{posix} doesn't seem to work for at least perl 5.34.
> > 
> > \p{print} seems to work for Documentation/devicetree/bindings/clock/apple,nco.yaml,
> > but I don't know how fragile it is.
> > 
> > \p{print} might be too greedy...
> 
> It is, it produces following diff (checking all files in 
> Documentation/devicetree/bindings):
> -Lubomir Rintel <lkundrak@v3.sk> (in file)
> +"Copyright 2019,2020 Lubomir Rintel" <lkundrak@v3.sk> (in file)
> 
> There are multiple hits of this form. The main issue is that \p{print} 
> includes space. That however fixes many names with 3 parts.

right

> > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
[]
> > @@ -2456,11 +2456,12 @@ sub clean_file_emails {
> >      foreach my $email (@file_emails) {
> >  	$email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
> >  	my ($name, $address) = parse_email($email);
> > +	$name =~ s/^\p{space}*\p{punct}*\p{space}*//;
> 
> This change is useful independently of the name regexp as it rejects
> '- <email@addr.ess>' (yaml list items) as valid name, email combination.

Good.  The below might be a bit better too:

	$name =~ s/(?:\p{space}|\p{punct})*//;


      reply	other threads:[~2022-09-18 21:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  8:47 Janne Grunau
2022-09-16 15:51 ` Martin Povišer
2022-09-17 14:11 ` Joe Perches
2022-09-18 17:03   ` Joe Perches
2022-09-18 20:32     ` Janne Grunau
2022-09-18 21:40       ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b683a340c820e7b55f7da047bfe3dd327db8ea5c.camel@perches.com \
    --to=joe@perches.com \
    --cc=j@jannau.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=povik+lin@cutebit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®