From patchwork Fri Oct 9 19:01:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 35642 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id A1BD3B7E3E for ; Sat, 10 Oct 2009 06:01:56 +1100 (EST) Received: by ozlabs.org (Postfix) id 695FDB7B99; Sat, 10 Oct 2009 06:01:48 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail.perches.com (mail.perches.com [173.55.12.10]) by ozlabs.org (Postfix) with ESMTP id D3606B7B96; Sat, 10 Oct 2009 06:01:47 +1100 (EST) Received: from [192.168.1.152] (new-host-3.home [192.168.1.152]) by mail.perches.com (Postfix) with ESMTP id 5593F24369; Fri, 9 Oct 2009 12:01:34 -0700 (PDT) Subject: Re: [RFC] scripts/get_maintainer: add emails based on keywords in the patch From: Joe Perches To: Wolfram Sang In-Reply-To: <1255087406.16347.108.camel@Joe-Laptop.home> References: <1255084379-12954-1-git-send-email-w.sang@pengutronix.de> <1255087406.16347.108.camel@Joe-Laptop.home> Date: Fri, 09 Oct 2009 12:01:45 -0700 Message-Id: <1255114905.16347.137.camel@Joe-Laptop.home> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Fri, 2009-10-09 at 04:23 -0700, Joe Perches wrote: > If this facility is desired by many others, it might be > better to have a separate file of 'regex generates email' > read at initialization. Perhaps it's better to use the existing MAINTAINERS file and extend it with a new "K:" for keyword entry. This patch is a bit longer than necessary because the MAINTAINERS initial descriptions are moved around a bit. Perhaps something like this: MAINTAINERS | 71 +++++++++++++++++++++++++------------------- scripts/get_maintainer.pl | 24 +++++++++++---- 2 files changed, 57 insertions(+), 38 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index e1da925..9e1263f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -65,43 +65,47 @@ trivial patch so apply some common sense. 8. Happy hacking. - ----------------------------------- - -Maintainers List (try to look for most precise areas first) +Descriptions of section entries: + + P: Person (obsolete) + M: Mail patches to: FullName + L: Mailing list that is relevant to this area + W: Web-page with status/info + T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. + S: Status, one of the following: + Supported: Someone is actually paid to look after this. + Maintained: Someone actually looks after it. + Odd Fixes: It has a maintainer but they don't have time to do + much other than throw the odd patch in. See below.. + Orphan: No current maintainer [but maybe you could take the + role as you write your new code]. + Obsolete: Old code. Something tagged obsolete generally means + it has been replaced by a better system and you + should be using that. + F: Files and directories with wildcard patterns. + A trailing slash includes all files and subdirectory files. + F: drivers/net/ all files in and below drivers/net + F: drivers/net/* all files in drivers/net, but not below + F: */net/* all files in "any top level directory"/net + One pattern per line. Multiple F: lines acceptable. + X: Files and directories that are NOT maintained, same rules as F: + Files exclusions are tested before file matches. + Can be useful for excluding a specific subdirectory, for instance: + F: net/ + X: net/ipv6/ + matches all files in and below net excluding net/ipv6/ + K: Keyword perl regex pattern to match content in patch + All patterns are surrounded by "\b" + for instance: K: of_get_profile + will match patches that contain the word "of_get_profile" Note: For the hard of thinking, this list is meant to remain in alphabetical order. If you could add yourselves to it in alphabetical order that would be so much easier [Ed] -P: Person (obsolete) -M: Mail patches to: FullName -L: Mailing list that is relevant to this area -W: Web-page with status/info -T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. -S: Status, one of the following: - - Supported: Someone is actually paid to look after this. - Maintained: Someone actually looks after it. - Odd Fixes: It has a maintainer but they don't have time to do - much other than throw the odd patch in. See below.. - Orphan: No current maintainer [but maybe you could take the - role as you write your new code]. - Obsolete: Old code. Something tagged obsolete generally means - it has been replaced by a better system and you - should be using that. +Maintainers List (try to look for most precise areas first) -F: Files and directories with wildcard patterns. - A trailing slash includes all files and subdirectory files. - F: drivers/net/ all files in and below drivers/net - F: drivers/net/* all files in drivers/net, but not below - F: */net/* all files in "any top level directory"/net - One pattern per line. Multiple F: lines acceptable. -X: Files and directories that are NOT maintained, same rules as F: - Files exclusions are tested before file matches. - Can be useful for excluding a specific subdirectory, for instance: - F: net/ - X: net/ipv6/ - matches all files in and below net excluding net/ipv6/ + ----------------------------------- 3C505 NETWORK DRIVER M: Philip Blundell @@ -3876,6 +3880,11 @@ S: Maintained F: Documentation/i2c/busses/i2c-ocores F: drivers/i2c/busses/i2c-ocores.c +OPEN FIRMWARE DEVICE TREE +L: devicetree-discuss@lists.ozlabs.org +S: Odd Fixes +K: of_get_property + OPROFILE M: Robert Richter L: oprofile-list@lists.sf.net diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index cdb44b6..657711c 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -132,6 +132,8 @@ if (!top_of_kernel_tree($lk_path)) { ## Read MAINTAINERS for type/value pairs my @typevalue = (); +my %keyword_hash; + open(MAINT, "<${lk_path}MAINTAINERS") || die "$P: Can't open MAINTAINERS\n"; while () { my $line = $_; @@ -149,6 +151,8 @@ while () { if ((-d $value)) { $value =~ s@([^/])$@$1/@; } + } elsif ($type eq "K") { + $keyword_hash{@typevalue} = $value; } push(@typevalue, "$type:$value"); } elsif (!/^(\s)*$/) { @@ -188,6 +192,12 @@ if ($email_remove_duplicates) { my @files = (); my @range = (); +my @email_to = (); +my @list_to = (); +my @scm = (); +my @web = (); +my @subsystem = (); +my @status = (); foreach my $file (@ARGV) { ##if $file is a directory and it lacks a trailing slash, add one @@ -203,6 +213,7 @@ foreach my $file (@ARGV) { my $lastfile; open(PATCH, "<$file") or die "$P: Can't open ${file}\n"; while () { + my $patch_line = $_; if (m/^\+\+\+\s+(\S+)/) { my $filename = $1; $filename =~ s@^[^/]*/@@; @@ -213,6 +224,12 @@ foreach my $file (@ARGV) { if ($email_git_blame) { push(@range, "$lastfile:$1:$2"); } + } else { + foreach my $line (keys %keyword_hash) { + if ($patch_line =~ m/^[+-].*\b$keyword_hash{$line}\b/o) { + add_categories($line); + } + } } } close(PATCH); @@ -224,13 +241,6 @@ foreach my $file (@ARGV) { } } -my @email_to = (); -my @list_to = (); -my @scm = (); -my @web = (); -my @subsystem = (); -my @status = (); - # Find responsible parties foreach my $file (@files) {