From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5B13C5519B for ; Mon, 27 Apr 2020 05:58:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 965C12075B for ; Mon, 27 Apr 2020 05:58:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 965C12075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE8CA89CB9; Mon, 27 Apr 2020 05:58:08 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28B4589CB9 for ; Mon, 27 Apr 2020 05:58:07 +0000 (UTC) Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id CC27680487; Mon, 27 Apr 2020 07:58:01 +0200 (CEST) Date: Mon, 27 Apr 2020 07:57:55 +0200 From: Sam Ravnborg To: Joe Perches Subject: Re: [PATCH] get_maintainer: Add email addresses from .yaml files Message-ID: <20200427055755.GA21898@ravnborg.org> References: <87d082jtfn.fsf@collabora.com> <20200420175909.GA5810@ravnborg.org> <9a32f150f85f851d04afd148b2a9a5cf203f7ce1.camel@perches.com> <7beaedfd63017973b910dd21cac13ecb42dbe503.camel@perches.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7beaedfd63017973b910dd21cac13ecb42dbe503.camel@perches.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=MOBOZvRl c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=8nJEP1OIZ-IA:10 a=IJv9LcIfAAAA:8 a=7gkXJVJtAAAA:8 a=e66IHeAwct5_nrS6dCUA:9 a=wPNLvfGTeEIA:10 a=cmr4hm9N53k6aw-X_--Q:22 a=E9Po1WZjFZOl8hwRPBS3:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Laurent Pinchart , Neil Armstrong , Adrian Ratiu , "linux-kernel@vger.kernel.org" , dri-devel , Andrzej Hajda , Rob Herring , Andrew Morton , Collabora Kernel ML Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Joe. On Sun, Apr 26, 2020 at 10:40:52PM -0700, Joe Perches wrote: > .yaml files can contain maintainer/author addresses and it seems > unlikely or unnecessary that individual MAINTAINER file section > entries for each .yaml file will be created. > = > So dd the email addresses found in .yaml files to the default ^ add > get_maintainer output. > = > The email addresses are marked with "(in file)" when using the > "--roles" or "--rolestats" options. > = > Miscellanea: > = > o Change $file_emails to $email_file_emails to avoid visual > naming conflicts with @file_emails > = > Signed-off-by: Joe Perches Acked-by: Sam Ravnborg Tested-by: Sam Ravnborg The patch did not apply on top of -rc3, but it was trivial to fix. Tested and works like a charm. Thanks for doing this! Sam > --- > scripts/get_maintainer.pl | 44 +++++++++++++++++++++++++++++------------= --- > 1 file changed, 29 insertions(+), 15 deletions(-) > = > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl > index 6cbcd1..6d973f 100755 > --- a/scripts/get_maintainer.pl > +++ b/scripts/get_maintainer.pl > @@ -57,7 +57,7 @@ my $status =3D 0; > my $letters =3D ""; > my $keywords =3D 1; > my $sections =3D 0; > -my $file_emails =3D 0; > +my $email_file_emails =3D 0; > my $from_filename =3D 0; > my $pattern_depth =3D 0; > my $self_test =3D undef; > @@ -69,6 +69,12 @@ my $vcs_used =3D 0; > = > my $exit =3D 0; > = > +my @files =3D (); > +my @fixes =3D (); # If a patch description includes Fixes: lines > +my @range =3D (); > +my @keyword_tvi =3D (); > +my @file_emails =3D (); > + > my %commit_author_hash; > my %commit_signer_hash; > = > @@ -266,7 +272,7 @@ if (!GetOptions( > 'pattern-depth=3Di' =3D> \$pattern_depth, > 'k|keywords!' =3D> \$keywords, > 'sections!' =3D> \$sections, > - 'fe|file-emails!' =3D> \$file_emails, > + 'fe|file-emails!' =3D> \$email_file_emails, > 'f|file' =3D> \$from_filename, > 'find-maintainer-files' =3D> \$find_maintainer_files, > 'mpath|maintainer-path=3Ds' =3D> \$maintainer_path, > @@ -424,6 +430,22 @@ sub read_all_maintainer_files { > } > } > = > +sub maintainers_in_file { > + my ($file) =3D @_; > + > + return if ($file =3D~ m@\bMAINTAINERS$@); > + > + if (-f $file && ($email_file_emails || $file =3D~ /\.yaml$/)) { > + open(my $f, '<', $file) > + or die "$P: Can't open $file: $!\n"; > + my $text =3D do { local($/) ; <$f> }; > + close($f); > + > + my @poss_addr =3D $text =3D~ m$[A-Za-z=C0-=FF\"\' \,\.\+-]*\s*[\,]*\s*[= \(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$= g; > + push(@file_emails, clean_file_emails(@poss_addr)); > + } > +} > + > # > # Read mail address map > # > @@ -504,12 +526,6 @@ sub read_mailmap { > = > ## use the filenames on the command line or find the filenames in the pa= tchfiles > = > -my @files =3D (); > -my @fixes =3D (); # If a patch description includes Fixes: lines > -my @range =3D (); > -my @keyword_tvi =3D (); > -my @file_emails =3D (); > - > if (!@ARGV) { > push(@ARGV, "&STDIN"); > } > @@ -527,7 +543,7 @@ foreach my $file (@ARGV) { > $file =3D~ s/^\Q${cur_path}\E//; #strip any absolute path > $file =3D~ s/^\Q${lk_path}\E//; #or the path to the lk tree > push(@files, $file); > - if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) { > + if ($file ne "MAINTAINERS" && -f $file && $keywords) { > open(my $f, '<', $file) > or die "$P: Can't open $file: $!\n"; > my $text =3D do { local($/) ; <$f> }; > @@ -539,10 +555,6 @@ foreach my $file (@ARGV) { > } > } > } > - if ($file_emails) { > - my @poss_addr =3D $text =3D~ m$[A-Za-z=C0-=FF\"\' \,\.\+-]*\s*[\,]*\s*= [\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}= $g; > - push(@file_emails, clean_file_emails(@poss_addr)); > - } > } > } else { > my $file_cnt =3D @files; > @@ -923,6 +935,8 @@ sub get_maintainers { > print("\n"); > } > } > + > + maintainers_in_file($file); > } > = > if ($keywords) { > @@ -1835,7 +1849,7 @@ tm toggle maintainers > tg toggle git entries > tl toggle open list entries > ts toggle subscriber list entries > -f emails in file [$file_emails] > +f emails in file [$email_file_emails] > k keywords in file [$keywords] > r remove duplicates [$email_remove_duplicates] > p# pattern match depth [$pattern_depth] > @@ -1960,7 +1974,7 @@ EOT > bool_invert(\$email_git_all_signature_types); > $rerun =3D 1; > } elsif ($sel eq "f") { > - bool_invert(\$file_emails); > + bool_invert(\$email_file_emails); > $rerun =3D 1; > } elsif ($sel eq "r") { > bool_invert(\$email_remove_duplicates); > = _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel