diff mbox

[RFC] get_maintainer: Look for arbitrary letter prefixes in sections

Message ID 1477332323.1984.8.camel@perches.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joe Perches Oct. 24, 2016, 6:05 p.m. UTC
Jani Nikula proposes patches to add a few new letter prefixes
for "B:" bug reporting and "C:" maintainer chatting to the
various sections of MAINTAINERS.

Add a generic mechanism to get_maintainer.pl to find sections that
have any combination of "[A-Z]" letter prefix types in a section.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/get_maintainer.pl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Paul Bolle Nov. 3, 2016, 9:07 a.m. UTC | #1
On Mon, 2016-10-24 at 11:05 -0700, Joe Perches wrote:
> Jani Nikula proposes patches to add a few new letter prefixes
> for "B:" bug reporting and "C:" maintainer chatting to the
> various sections of MAINTAINERS.
> 
> Add a generic mechanism to get_maintainer.pl to find sections that
> have any combination of "[A-Z]" letter prefix types in a section.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

This patch made it into linux-next (ie, next-20161028).

> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl

> @@ -271,7 +273,8 @@ $output_multiline = 0 if ($output_separator ne ", ");
>  $output_rolestats = 1 if ($interactive);
>  $output_roles = 1 if ($output_rolestats);
>  
> -if ($sections) {
> +if ($sections || $letters ne "") {
> +    $sections = 1;

This triggers:
    Unrecognized character \xA0; marked by <-- HERE after <-- HERE near column 1 at ./scripts/get_maintainer.pl line 277.

Git blame shows:
    git blame -L 277,+1 ./scripts/get_maintainer.pl
    b67071653d3fc (Joe Perches 2016-10-28 13:22:01 +1100 277) <A0><A0><A0><A0>$sections = 1;

(A0 seems to be the no break space. That character was inserted more
often further down the patch.)

Anybody else seeing this?


Paul Bolle
Joe Perches Nov. 3, 2016, 9:16 a.m. UTC | #2
On Thu, 2016-11-03 at 10:07 +0100, Paul Bolle wrote:
> On Mon, 2016-10-24 at 11:05 -0700, Joe Perches wrote:
> > Jani Nikula proposes patches to add a few new letter prefixes
> > for "B:" bug reporting and "C:" maintainer chatting to the
> > various sections of MAINTAINERS.
> > 
> > Add a generic mechanism to get_maintainer.pl to find sections that
> > have any combination of "[A-Z]" letter prefix types in a section.
> > 
> > Signed-off-by: Joe Perches <joe@perches.com>
> 
> This patch made it into linux-next (ie, next-20161028).
> 
> > --- a/scripts/get_maintainer.pl
> > +++ b/scripts/get_maintainer.pl
> > @@ -271,7 +273,8 @@ $output_multiline = 0 if ($output_separator ne ", ");
> >  $output_rolestats = 1 if ($interactive);
> >  $output_roles = 1 if ($output_rolestats);
> >  
> > -if ($sections) {
> > +if ($sections || $letters ne "") {
> > +    $sections = 1;
> 
> This triggers:
>     Unrecognized character \xA0; marked by <-- HERE after <-- HERE near column 1 at ./scripts/get_maintainer.pl line 277.
> 
> Git blame shows:
>     git blame -L 277,+1 ./scripts/get_maintainer.pl
>     b67071653d3fc (Joe Perches 2016-10-28 13:22:01 +1100 277) <A0><A0><A0><A0>$sections = 1;
> 
> (A0 seems to be the no break space. That character was inserted more
> often further down the patch.)
> 
> Anybody else seeing this?

Yes, it's been reported and should be fixed in -mm.
The fix should show up in -next in a little bit.

For now, try:
$ sed -i -e 's/\xA0/ /g' scripts/get_maintainer.pl

cheers, Joe
Paul Bolle Nov. 3, 2016, 9:18 a.m. UTC | #3
On Thu, 2016-11-03 at 02:16 -0700, Joe Perches wrote:
> Yes, it's been reported and should be fixed in -mm.
> The fix should show up in -next in a little bit.

Great.

> For now, try:
> $ sed -i -e 's/\xA0/ /g' scripts/get_maintainer.pl

Thanks,


Paul Bolle
diff mbox

Patch

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index aed4511f0304..633f2dd3de27 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -49,6 +49,7 @@  my $scm = 0;
 my $web = 0;
 my $subsystem = 0;
 my $status = 0;
+my $letters = "";
 my $keywords = 1;
 my $sections = 0;
 my $file_emails = 0;
@@ -241,6 +242,7 @@  if (!GetOptions(
 		'status!' => \$status,
 		'scm!' => \$scm,
 		'web!' => \$web,
+		'letters=s' => \$letters,
 		'pattern-depth=i' => \$pattern_depth,
 		'k|keywords!' => \$keywords,
 		'sections!' => \$sections,
@@ -271,7 +273,8 @@  $output_multiline = 0 if ($output_separator ne ", ");
 $output_rolestats = 1 if ($interactive);
 $output_roles = 1 if ($output_rolestats);
 
-if ($sections) {
+if ($sections || $letters ne "") {
+    $sections = 1;
     $email = 0;
     $email_list = 0;
     $scm = 0;
@@ -682,8 +685,10 @@  sub get_maintainers {
 			$line =~ s/\\\./\./g;       	##Convert \. to .
 			$line =~ s/\.\*/\*/g;       	##Convert .* to *
 		    }
-		    $line =~ s/^([A-Z]):/$1:\t/g;
-		    print("$line\n");
+		    my $count = $line =~ s/^([A-Z]):/$1:\t/g;
+		    if ($letters eq "" || (!$count || $letters =~ /$1/i)) {
+			print("$line\n");
+		    }
 		}
 		print("\n");
 	    }
@@ -814,6 +819,7 @@  Other options:
   --pattern-depth => Number of pattern directory traversals (default: 0 (all))
   --keywords => scan patch for keywords (default: $keywords)
   --sections => print all of the subsystem sections with pattern matches
+  --letters => print all matching 'letter' types from all matching sections
   --mailmap => use .mailmap file (default: $email_use_mailmap)
   --version => show version
   --help => show this help information