* [RFC] scripts/get_maintainer: add emails based on keywords in the patch
@ 2009-10-09 10:32 Wolfram Sang
2009-10-09 11:23 ` Joe Perches
2009-10-09 15:46 ` Grant Likely
0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2009-10-09 10:32 UTC (permalink / raw)
To: linux-kernel; +Cc: devicetree-discuss, linuxppc-dev, Joe Perches
Make get_maintainer.pl scan the modifying lines of a patch for a list of
keywords and add an associated email if found. The first user is the
devicetree-discuss mailing list which should always be cc'ed if a device tree
property is inserted/removed (keyword 'of_get_property'). This patch is the
result from commit 1965d30356c1c65660ba3330927671cfe81acdd5 entering mainline
which seems to have been missed by all parties interested in the device tree
(and at least had the documentation missing). As adding properties can happen
anywhere and so there is no fitting fileglob, this keyword based approach is
proposed.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Joe Perches <joe@perches.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
---
scripts/get_maintainer.pl | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index cdb44b6..e1150ea 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -44,6 +44,11 @@ my $help = 0;
my $exit = 0;
+my %keywords_to_mail = (
+ 'of_get_property' => 'L: devicetree-discuss@lists.ozlabs.org',
+);
+my $keywords_to_mail_match = join('|', keys %keywords_to_mail);
+
my @penguin_chief = ();
push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org");
#Andrew wants in on most everything - 2009/01/14
@@ -188,6 +193,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
@@ -213,7 +224,11 @@ foreach my $file (@ARGV) {
if ($email_git_blame) {
push(@range, "$lastfile:$1:$2");
}
- }
+ # Check the lines which a patch modifies for keywords; add mail if found.
+ } elsif (m/^[+-].*($keywords_to_mail_match)/o) {
+ (my $keyword_mail = $keywords_to_mail{$1}) =~ s/^([LM]): //;
+ push( @{ ($1 eq 'L') ? \@list_to : \@email_to }, $keyword_mail );
+ }
}
close(PATCH);
if ($file_cnt == @files) {
@@ -224,13 +239,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) {
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC] scripts/get_maintainer: add emails based on keywords in the patch
2009-10-09 10:32 [RFC] scripts/get_maintainer: add emails based on keywords in the patch Wolfram Sang
@ 2009-10-09 11:23 ` Joe Perches
2009-10-09 19:01 ` Joe Perches
2009-10-09 15:46 ` Grant Likely
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2009-10-09 11:23 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, devicetree-discuss, linux-kernel
On Fri, 2009-10-09 at 12:32 +0200, Wolfram Sang wrote:
> +my %keywords_to_mail = (
> + 'of_get_property' => 'L: devicetree-discuss@lists.ozlabs.org',
maybe: '\bof_get_property\b'
> + # Check the lines which a patch modifies for keywords; add mail if found.
> + } elsif (m/^[+-].*($keywords_to_mail_match)/o) {
> + (my $keyword_mail = $keywords_to_mail{$1}) =~ s/^([LM]): //;
> + push( @{ ($1 eq 'L') ? \@list_to : \@email_to }, $keyword_mail );
> + }
If this facility is desired by many others, it might be
better to have a separate file of 'regex generates email'
read at initialization.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] scripts/get_maintainer: add emails based on keywords in the patch
2009-10-09 10:32 [RFC] scripts/get_maintainer: add emails based on keywords in the patch Wolfram Sang
2009-10-09 11:23 ` Joe Perches
@ 2009-10-09 15:46 ` Grant Likely
1 sibling, 0 replies; 5+ messages in thread
From: Grant Likely @ 2009-10-09 15:46 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Joe Perches, linuxppc-dev, devicetree-discuss, linux-kernel
On Fri, Oct 9, 2009 at 4:32 AM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> Make get_maintainer.pl scan the modifying lines of a patch for a list of
> keywords and add an associated email if found. The first user is the
> devicetree-discuss mailing list which should always be cc'ed if a device =
tree
> property is inserted/removed (keyword 'of_get_property'). This patch is t=
he
> result from commit 1965d30356c1c65660ba3330927671cfe81acdd5 entering main=
line
> which seems to have been missed by all parties interested in the device t=
ree
> (and at least had the documentation missing). As adding properties can ha=
ppen
> anywhere and so there is no fitting fileglob, this keyword based approach=
is
> proposed.
Nice. I cannot comment on the implementation, but I like the approach.
g.
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Joe Perches <joe@perches.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> =A0scripts/get_maintainer.pl | =A0 24 ++++++++++++++++--------
> =A01 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index cdb44b6..e1150ea 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -44,6 +44,11 @@ my $help =3D 0;
>
> =A0my $exit =3D 0;
>
> +my %keywords_to_mail =3D (
> + =A0 =A0 =A0 'of_get_property' =3D> 'L: devicetree-discuss@lists.ozlabs.=
org',
> +);
> +my $keywords_to_mail_match =3D join('|', keys %keywords_to_mail);
> +
> =A0my @penguin_chief =3D ();
> =A0push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org");
> =A0#Andrew wants in on most everything - 2009/01/14
> @@ -188,6 +193,12 @@ if ($email_remove_duplicates) {
>
> =A0my @files =3D ();
> =A0my @range =3D ();
> +my @email_to =3D ();
> +my @list_to =3D ();
> +my @scm =3D ();
> +my @web =3D ();
> +my @subsystem =3D ();
> +my @status =3D ();
>
> =A0foreach my $file (@ARGV) {
> =A0 =A0 ##if $file is a directory and it lacks a trailing slash, add one
> @@ -213,7 +224,11 @@ foreach my $file (@ARGV) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ($email_git_blame) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0push(@range, "$lastfile:$1:$2");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 =A0 =A0 # Check the lines which a patch modifies for keywor=
ds; add mail if found.
> + =A0 =A0 =A0 =A0 =A0 } elsif (m/^[+-].*($keywords_to_mail_match)/o) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 (my $keyword_mail =3D $keywords_to_mail{$1}=
) =3D~ s/^([LM]): //;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 push( @{ ($1 eq 'L') ? \@list_to : \@email_=
to }, $keyword_mail );
> + =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0close(PATCH);
> =A0 =A0 =A0 =A0if ($file_cnt =3D=3D @files) {
> @@ -224,13 +239,6 @@ foreach my $file (@ARGV) {
> =A0 =A0 }
> =A0}
>
> -my @email_to =3D ();
> -my @list_to =3D ();
> -my @scm =3D ();
> -my @web =3D ();
> -my @subsystem =3D ();
> -my @status =3D ();
> -
> =A0# Find responsible parties
>
> =A0foreach my $file (@files) {
> --
> 1.6.3.3
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] scripts/get_maintainer: add emails based on keywords in the patch
2009-10-09 11:23 ` Joe Perches
@ 2009-10-09 19:01 ` Joe Perches
2009-10-10 9:03 ` Wolfram Sang
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2009-10-09 19:01 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, devicetree-discuss, linux-kernel
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 <address@domain>
+ 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 <address@domain>
-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 <philb@gnu.org>
@@ -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 <robert.richter@amd.com>
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 (<MAINT>) {
my $line = $_;
@@ -149,6 +151,8 @@ while (<MAINT>) {
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 (<PATCH>) {
+ 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) {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC] scripts/get_maintainer: add emails based on keywords in the patch
2009-10-09 19:01 ` Joe Perches
@ 2009-10-10 9:03 ` Wolfram Sang
0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2009-10-10 9:03 UTC (permalink / raw)
To: Joe Perches; +Cc: linuxppc-dev, devicetree-discuss, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 879 bytes --]
> Perhaps it's better to use the existing MAINTAINERS file
> and extend it with a new "K:" for keyword entry.
Yeah, makes sense to have everything in one file.
> + 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"
...in the lines which are changed?
> +OPEN FIRMWARE DEVICE TREE
> +L: devicetree-discuss@lists.ozlabs.org
> +S: Odd Fixes
Maintained, I'd say. Especially as Grant Likely recently said he wants to take care about OF.
> +K: of_get_property
F: drivers/of/
Will check the script later this weekend.
Thanks,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-10 9:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09 10:32 [RFC] scripts/get_maintainer: add emails based on keywords in the patch Wolfram Sang
2009-10-09 11:23 ` Joe Perches
2009-10-09 19:01 ` Joe Perches
2009-10-10 9:03 ` Wolfram Sang
2009-10-09 15:46 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).