mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: florian@mickler.org, Andrew Morton <akpm@linux-foundation.org>,
	"Stephen Hemminger (role:commit_signer)" <shemminger@vyatta.com>,
	"Wolfram Sang (role:commit_signer)" <w.sang@pengutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] get_maintainer.pl: append reason for cc to the name by default
Date: Sat, 11 Sep 2010 14:22:00 -0700	[thread overview]
Message-ID: <1284240120.12180.111.camel@Joe-Laptop> (raw)
In-Reply-To: <20100910095259.GC23903@sirena.org.uk>

On Fri, 2010-09-10 at 10:53 +0100, Mark Brown wrote:
> On Fri, Sep 10, 2010 at 02:42:47AM -0700, Joe Perches wrote:
> > As the coverage of file patterns in MAINTAINERS is
> > now pretty good, the --git results are less useful.
> It's pretty good for subsystems and PC drivers but for embedded stuff it
> is much more patchy and fairly unlikely to find someone who actually
> knows about the specific hardware.
> > I'd much rather turn off --git as a default, or change
> > get_maintainers to add git signers only when there's no
> > specifically listed maintainer for a particular file.
> OTOH I'd still be somewhat in favour of this purely on the basis that
> the default results have way too many false positives.

Maybe something like this?

Add --git-fallback default enabled to add commit signers
only when there's no specifically listed maintainer.

Change --git default to off

 scripts/get_maintainer.pl |   41 +++++++++++++++++++++++------------------
 1 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index a91ae63..0c4de78 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -24,9 +24,10 @@ my $email_maintainer = 1;
 my $email_list = 1;
 my $email_subscriber_list = 0;
 my $email_git_penguin_chiefs = 0;
-my $email_git = 1;
+my $email_git = 0;
 my $email_git_all_signature_types = 0;
 my $email_git_blame = 0;
+my $email_git_fallback = 1;
 my $email_git_min_signatures = 1;
 my $email_git_max_maintainers = 5;
 my $email_git_min_percent = 5;
@@ -138,6 +139,7 @@ if (!GetOptions(
 		'git!' => \$email_git,
 		'git-all-signature-types!' => \$email_git_all_signature_types,
 		'git-blame!' => \$email_git_blame,
+		'git-fallback!' => \$email_git_fallback,
 		'git-chief-penguins!' => \$email_git_penguin_chiefs,
 		'git-min-signatures=i' => \$email_git_min_signatures,
 		'git-max-maintainers=i' => \$email_git_max_maintainers,
@@ -371,6 +373,7 @@ my @status = ();
 foreach my $file (@files) {
 
     my %hash;
+    my $has_exact_pd = 0;
     my $tvi = find_first_section();
     while ($tvi < @typevalue) {
 	my $start = find_starting_index($tvi);
@@ -405,6 +408,7 @@ foreach my $file (@files) {
 			    my $value_pd = ($value =~ tr@/@@);
 			    my $file_pd = ($file  =~ tr@/@@);
 			    $value_pd++ if (substr($value,-1,1) ne "/");
+			    $has_exact_pd = 1 if ($file_pd == $value_pd);
 			    if ($pattern_depth == 0 ||
 				(($file_pd - $value_pd) < $pattern_depth)) {
 				$hash{$tvi} = $value_pd;
@@ -420,26 +424,26 @@ foreach my $file (@files) {
 
     foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
 	add_categories($line);
-	    if ($sections) {
-		my $i;
-		my $start = find_starting_index($line);
-		my $end = find_ending_index($line);
-		for ($i = $start; $i < $end; $i++) {
-		    my $line = $typevalue[$i];
-		    if ($line =~ /^[FX]:/) {		##Restore file patterns
-			$line =~ s/([^\\])\.([^\*])/$1\?$2/g;
-			$line =~ s/([^\\])\.$/$1\?/g;	##Convert . back to ?
-			$line =~ s/\\\./\./g;       	##Convert \. to .
-			$line =~ s/\.\*/\*/g;       	##Convert .* to *
-		    }
-		    $line =~ s/^([A-Z]):/$1:\t/g;
-		    print("$line\n");
+	if ($sections) {
+	    my $i;
+	    my $start = find_starting_index($line);
+	    my $end = find_ending_index($line);
+	    for ($i = $start; $i < $end; $i++) {
+		my $line = $typevalue[$i];
+		if ($line =~ /^[FX]:/) {		##Restore file patterns
+		    $line =~ s/([^\\])\.([^\*])/$1\?$2/g;
+		    $line =~ s/([^\\])\.$/$1\?/g;	##Convert . back to ?
+		    $line =~ s/\\\./\./g;       	##Convert \. to .
+		    $line =~ s/\.\*/\*/g;       	##Convert .* to *
 		}
-		print("\n");
+		$line =~ s/^([A-Z]):/$1:\t/g;
+		print("$line\n");
 	    }
+	    print("\n");
+	}
     }
 
-    if ($email && $email_git) {
+    if ($email && ($email_git || ($email_git_fallback && !$has_exact_pd))) {
 	vcs_file_signoffs($file);
     }
 
@@ -540,6 +544,7 @@ MAINTAINER field selection options:
     --git => include recent git \*-by: signers
     --git-all-signature-types => include signers regardless of signature type
         or use only ${signaturePattern} signers (default: $email_git_all_signature_types)
+    --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
     --git-chief-penguins => include ${penguin_chiefs}
     --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
     --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
@@ -568,7 +573,7 @@ Output type options:
 Other options:
   --pattern-depth => Number of pattern directory traversals (default: 0 (all))
   --keywords => scan patch for keywords (default: 1 (on))
-  --sections => print the entire subsystem sections with pattern matches
+  --sections => only print the entire subsystem sections with pattern matches
   --version => show version
   --help => show this help information
 



  parent reply	other threads:[~2010-09-11 21:22 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10  9:33 florian
2010-09-10  9:42 ` Joe Perches
2010-09-10  9:46   ` Wolfram Sang
2010-09-10  9:53   ` Mark Brown
2010-09-10 10:04     ` Joe Perches
2010-09-10 10:18       ` Mark Brown
2010-09-10 10:47         ` Joe Perches
2010-09-10 11:07           ` Mark Brown
2010-09-11  0:22           ` [PATCH] scripts/get_maintainer.pl: Add --git-blame --rolestats "Authored lines" information Joe Perches
2010-09-11  9:38             ` Florian Mickler
2010-09-11  9:52               ` Joe Perches
2010-09-11 10:02                 ` Florian Mickler
2010-09-11 10:22                   ` Joe Perches
2010-09-11 19:22                   ` [PATCH] Documentation/SubmittingPatches: Add and describe scripts/get_maintainer.pl Joe Perches
2010-09-11 19:34                     ` Florian Mickler
2010-09-11 19:43                     ` [PATCH V2] " Joe Perches
2010-09-12 16:18                       ` Florian Mickler
2010-09-10 11:44         ` [PATCH] get_maintainer.pl: append reason for cc to the name by default Alan Cox
2010-09-10 10:22       ` Florian Mickler
2010-09-10 10:47         ` Joe Perches
2010-09-11 21:22     ` Joe Perches [this message]
2010-09-10 10:30   ` Florian Mickler
2010-09-10 11:04     ` Mark Brown
2010-09-10 11:15       ` Florian Mickler
2010-09-10 21:04     ` Andrew Morton
2010-09-10 21:39       ` Florian Mickler
2010-09-10 21:44       ` Joe Perches
2010-09-13  4:01     ` Valdis.Kletnieks
2010-09-13  5:21       ` [PATCH] get_maintainer.pl: Look for .get_maintainer.conf in lk, then $HOME then scripts Joe Perches
2010-09-13  6:13         ` Florian Mickler
2010-09-13 13:21         ` Valdis.Kletnieks
2010-09-10 11:11   ` [PATCH] get_maintainer.pl: append reason for cc to the name by default Florian Mickler
2010-09-10 15:12     ` Joe Perches
2010-09-11  9:34       ` Florian Mickler
2010-09-11  0:13   ` Christoph Hellwig
2010-09-11  0:31     ` Joe Perches
2010-09-11  0:45       ` Christoph Hellwig
2010-09-11  0:56         ` Joe Perches
2010-09-11  9:28         ` Florian Mickler
2010-09-13  7:16           ` Eric W. Biederman
2010-09-13  7:57             ` Joe Perches
2010-09-13  8:54               ` Florian Mickler
2010-09-14 17:19                 ` Eric W. Biederman
2010-09-14 17:46                   ` Florian Mickler
2010-09-15  3:28                     ` Joe Perches
2010-09-15  4:34                       ` Florian Mickler
2010-09-15  4:45                         ` Joe Perches
2010-09-15 12:49                           ` Florian Mickler
2010-09-14 23:15                   ` Joe Perches
2010-09-13  9:01             ` Florian Mickler
2010-09-14 17:24               ` Eric W. Biederman
2010-09-26 18:52 ` RFC: " Joe Perches
2010-09-27 14:57   ` Florian Mickler
2010-09-27 15:44     ` Ted Ts'o
2010-09-27 17:00       ` Florian Mickler
2010-09-27 18:21         ` Ted Ts'o
2010-09-27 19:26           ` Florian Mickler
2010-09-27 20:08             ` Joe Perches
2010-09-27 20:47               ` Ted Ts'o
2010-09-27 21:16                 ` Joe Perches
2010-09-28  4:22                   ` Ted Ts'o
2010-09-28  4:37                   ` Mark Brown

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=1284240120.12180.111.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=florian@mickler.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=w.sang@pengutronix.de \
    /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®