All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: randy.dunlap@oracle.com, torvalds@linux-foundation.org,
	akpm@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/10] MAINTAINERS - add script, patterns and misc updates
Date: Fri, 17 Apr 2009 15:09:28 -0700	[thread overview]
Message-ID: <1240006168.31116.62.camel@localhost> (raw)
In-Reply-To: <20090417144117.4ac8828f.akpm@linux-foundation.org>

On Fri, 2009-04-17 at 14:41 -0700, Andrew Morton wrote:
> Lots of people's scripts/get_maintainer.pl files won't have the `x' bit
> set because patch(1) is dumb.  So for reliability it's best to always do

git at least persisted the "x" bit.
checkpatch doesn't say to use perl.

> 	perl ./scripts/get_maintainer.pl

OK by me.

> : akpm:/usr/src/25> perl scripts/get_maintainer.pl -f fs/ext3/inode.c 
> : grep: The -P option is not supported
>     that's odd.  `man grep' on this machine says

I changed the script grep to use "-E", which is older.

> : fatal: Not a git repository
> 
>     it whines about not being run in a git directory, but does a decent
>     job anyway.  

Oh, I see, you've git installed, but not in your
/usr/src/25 directory.

I changed the script to verify that a .git directory
exists before running git.

How about with these 2 patches applied?

1: Update scripts/get_maintainer.pl
   better subscriber-only mailing list checks
   use grep -E not grep -P, works with earlier version of grep
   check path for .git before using git
   Output maintainers before mailing lists
   Don't auto-add linux-kernel@vger.kernel.org
2: Update MAINTAINERS
   Add file patterns to "THE REST"
   Add L: linux-kernel@vger.kernel.org to "THE REST"

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 60dc0c4..8ba7b3b 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -13,7 +13,7 @@
 use strict;
 
 my $P = $0;
-my $V = '0.15';
+my $V = '0.16';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -169,6 +169,7 @@ foreach my $file (@ARGV) {
 }
 
 my @email_to = ();
+my @list_to = ();
 my @scm = ();
 my @web = ();
 my @subsystem = ();
@@ -182,7 +183,7 @@ foreach my $file (@files) {
 
     my $exclude = 0;
     foreach my $line (@typevalue) {
-	if ($line =~ m/^(\C):(.*)/) {
+	if ($line =~ m/^(\C):\s*(.*)/) {
 	    my $type = $1;
 	    my $value = $2;
 	    if ($type eq 'X') {
@@ -196,7 +197,7 @@ foreach my $file (@files) {
     if (!$exclude) {
 	my $tvi = 0;
 	foreach my $line (@typevalue) {
-	    if ($line =~ m/^(\C):(.*)/) {
+	    if ($line =~ m/^(\C):\s*(.*)/) {
 		my $type = $1;
 		my $value = $2;
 		if ($type eq 'F') {
@@ -215,29 +216,33 @@ foreach my $file (@files) {
 
 }
 
-if ($email_git_penguin_chiefs) {
+if ($email) {
     foreach my $chief (@penguin_chief) {
 	if ($chief =~ m/^(.*):(.*)/) {
-	    my $chief_name = $1;
-	    my $chief_addr = $2;
+	    my $email_address;
 	    if ($email_usename) {
-		push(@email_to, format_email($chief_name, $chief_addr));
+		$email_address = format_email($1, $2);
 	    } else {
-		push(@email_to, $chief_addr);
+		$email_address = $2;
 	    }
+	    if ($email_git_penguin_chiefs) {
+		push(@email_to, $email_address);
+	    } else {
+		@email_to = grep(!/${email_address}/, @email_to);
+	    }		
 	}
     }
 }
 
-if ($email) {
-    my $address_cnt = @email_to;
-    if ($address_cnt == 0 && $email_list) {
-	push(@email_to, "linux-kernel\@vger.kernel.org");
+if ($email || $email_list) {
+    my @to = ();
+    if ($email) {
+	@to = (@to, @email_to);
     }
-
-#Don't sort email address list, but do remove duplicates
-    @email_to = uniq(@email_to);
-    output(@email_to);
+    if ($email_list) {
+	@to = (@to, @list_to);
+    }
+    output(uniq(@to));
 }
 
 if ($scm) {
@@ -307,10 +312,10 @@ Output type options:
   --multiline => print 1 entry per line
 
 Default options:
-  [--email --git --m --l --multiline]
+  [--email --git --m --n --l --multiline]
 
 Other options:
-  --version -> show version
+  --version => show version
   --help => show this help information
 
 EOT
@@ -366,26 +371,30 @@ sub add_categories {
     $index = $index - 1;
     while ($index >= 0) {
 	my $tv = $typevalue[$index];
-	if ($tv =~ m/^(\C):(.*)/) {
+	if ($tv =~ m/^(\C):\s*(.*)/) {
 	    my $ptype = $1;
 	    my $pvalue = $2;
 	    if ($ptype eq "L") {
-		my $subscr = $pvalue;
-		if ($subscr =~ m/\s*\(subscribers-only\)/) {
+		my $list_address = $pvalue;
+		my $list_additional = "";
+		if ($list_address =~ m/([^\s]+)\s+(.*)$/) {
+		    $list_address = $1;
+		    $list_additional = $2;
+		}
+		if ($list_additional =~ m/subscribers-only/) {
 		    if ($email_subscriber_list) {
-			$subscr =~ s/\s*\(subscribers-only\)//g;
-			push(@email_to, $subscr);
+			push(@list_to, $list_address);
 		    }
 		} else {
 		    if ($email_list) {
-			push(@email_to, $pvalue);
+			push(@list_to, $list_address);
 		    }
 		}
 	    } elsif ($ptype eq "M") {
 		if ($email_maintainer) {
 		    if ($index >= 0) {
 			my $tv = $typevalue[$index - 1];
-			if ($tv =~ m/^(\C):(.*)/) {
+			if ($tv =~ m/^(\C):\s*(.*)/) {
 			    if ($1 eq "P" && $email_usename) {
 				push(@email_to, format_email($2, $pvalue));
 			    } else {
@@ -415,7 +424,7 @@ sub add_categories {
 sub which {
     my ($bin) = @_;
 
-    foreach my $path (split /:/, $ENV{PATH}) {
+    foreach my $path (split(/:/, $ENV{PATH})) {
 	if (-e "$path/$bin") {
 	    return "$path/$bin";
 	}
@@ -433,17 +442,16 @@ sub recent_git_signoffs {
     my $count = 0;
     my @lines = ();
 
+    if (!(-d ".git")) {
+	return;
+    }
     if (which("git") eq "") {
 	die("$P: git not found.  Add --nogit to options?\n");
     }
 
     $cmd = "git log --since=${email_git_since} -- ${file}";
-    $cmd .= " | grep -Pi \"^[-_ 	a-z]+by:.*\\\@\"";
-    if (!$email_git_penguin_chiefs) {
-	$cmd .= " | grep -Pv \"${penguin_chiefs}\"";
-    }
+    $cmd .= " | grep -Ei \"^[-_ 	a-z]+by:.*\\\@.*\$\"";
     $cmd .= " | cut -f2- -d\":\"";
-    $cmd .= " | sed -e \"s/^\\s+//g\"";
     $cmd .= " | sort | uniq -c | sort -rn";
 
     $output = `${cmd}`;
@@ -481,7 +489,6 @@ sub recent_git_signoffs {
 	    push(@email_to, $line);
 	}
     }
-    return $output;
 }
 
 sub uniq {
diff --git a/MAINTAINERS b/MAINTAINERS
index abbedb6..e35f589 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6275,5 +6329,10 @@ F:	drivers/serial/zs.*
 
 THE REST
 P:	Linus Torvalds
+M:	torvalds@linux-foundation.org
+L:	linux-kernel@vger.kernel.org
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
 S:	Buried alive in reporters
+F:	*
+F:	*/
+




  parent reply	other threads:[~2009-04-17 22:12 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  5:17 [PATCH 0/10] MAINTAINERS - add script, patterns and misc updates Joe Perches
2009-04-08  5:17 ` [PATCH 01/10] Add scripts/get_maintainer.pl Joe Perches
2009-04-08  5:17 ` [PATCH 02/10] MAINTAINERS - Add file patterns Joe Perches
2009-04-08  6:59   ` Geert Uytterhoeven
2009-04-08  6:59     ` Geert Uytterhoeven
2009-04-08 15:44     ` Joe Perches
2009-04-08 14:13   ` Mauro Carvalho Chehab
2009-04-08 15:35     ` Joe Perches
2009-04-17  4:45       ` Mauro Carvalho Chehab
2009-04-08 16:51   ` Greg KH
2009-04-08 17:07     ` Joe Perches
2009-04-08 17:11       ` Greg KH
2009-04-09 15:42   ` Timur Tabi
2009-04-09 17:42     ` Joe Perches
2009-04-09 17:44       ` Timur Tabi
2009-04-08  5:17 ` [PATCH 03/10] MAINTAINERS - Standardize style Joe Perches
2009-04-08  5:17 ` [PATCH 04/10] MAINTAINERS - Remove HP Fibre Channel HBA no longer in tree Joe Perches
2009-04-08  5:17 ` [PATCH 05/10] MAINTAINERS - standardize "T: git urls" Joe Perches
2009-04-08  5:17 ` [PATCH 06/10] MAINTAINERS - Add Linus Torvalds' git Joe Perches
2009-04-08  5:17 ` [PATCH 07/10] MAINTAINERS - i2c_tiny_usb T: should be W: Joe Perches
2009-04-08  5:17 ` [PATCH 08/10] MAINTAINERS - Update FPU Emulator contact address and web page Joe Perches
2009-04-08  5:17 ` [PATCH 09/10] MAINTAINERS - Remove x86/Voyager no longer in tree Joe Perches
2009-04-08  5:17 ` [PATCH 10/10] MAINTAINERS - Remove cyblafb frame buffer " Joe Perches
2009-04-17 20:47 ` [PATCH 0/10] MAINTAINERS - add script, patterns and misc updates Randy Dunlap
2009-04-17 21:27   ` Joe Perches
2009-04-07  8:13     ` Pavel Machek
2009-04-22 15:54       ` Joe Perches
2009-04-22 18:59         ` Sam Ravnborg
2009-04-22 19:05           ` Andrew Morton
2009-04-22 19:56             ` Joe Perches
2009-04-22 20:30               ` Pavel Machek
2009-04-22 20:34                 ` Joe Perches
2009-04-24  7:13                 ` Joe Perches
2009-05-10 20:26                   ` RFC: MAINTAINER email address style? Joe Perches
2009-05-10 20:53                     ` Sam Ravnborg
2009-05-10 21:00                       ` Joe Perches
2009-05-10 21:09                         ` Sam Ravnborg
2009-05-10 21:45                           ` Bartlomiej Zolnierkiewicz
2009-05-11  1:37                             ` KOSAKI Motohiro
2009-05-11  0:48                       ` Andrew Morton
2009-05-10 21:22                     ` Pavel Machek
2009-05-10 21:24                     ` Alan Cox
2009-05-10 21:36                       ` Pavel Machek
2009-05-10 22:46                         ` Alan Cox
2009-05-10 21:52                       ` Joe Perches
2009-05-10 22:04                         ` Alan Cox
2009-05-10 22:35                           ` Joe Perches
2009-05-13  0:03                     ` [GIT PULL] MAINTAINERS, scripts/get_maintainer.pl, and Documentation/SubmittingPatches Joe Perches
2009-04-17 21:30     ` [PATCH 0/10] MAINTAINERS - add script, patterns and misc updates Randy Dunlap
2009-04-17 21:41     ` Andrew Morton
2009-04-17 21:58       ` Linus Torvalds
2009-04-17 22:09       ` Joe Perches [this message]
2009-04-17 22:18         ` Andrew Morton
2009-04-17 22:53           ` Joe Perches

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=1240006168.31116.62.camel@localhost \
    --to=joe@perches.com \
    --cc=akpm@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=torvalds@linux-foundation.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 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.