* [PATCH] get_maintainer: apply all .get_maintainer.ignore files
@ 2017-04-05 11:30 Jeffy Chen
2017-04-05 16:06 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Jeffy Chen @ 2017-04-05 11:30 UTC (permalink / raw)
To: linux-kernel; +Cc: joe, briannorris, dianders, Jeffy Chen
Currently we are searching "./:$ENV{HOME}/:.scripts/" for ignore file,
but would always get "./.get_maintainer.ignore" only.
This patch applies all .get_maintainer.ignore, so it would be easier to
add ignore list locally.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
scripts/get_maintainer.pl | 49 ++++++++++++++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 18 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 633f2dd..357e171 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -193,24 +193,26 @@ if (-f $conf) {
}
my @ignore_emails = ();
-my $ignore_file = which_conf(".get_maintainer.ignore");
-if (-f $ignore_file) {
- open(my $ignore, '<', "$ignore_file")
- or warn "$P: Can't find a readable .get_maintainer.ignore file $!\n";
- while (<$ignore>) {
- my $line = $_;
-
- $line =~ s/\s*\n?$//;
- $line =~ s/^\s*//;
- $line =~ s/\s+$//;
- $line =~ s/#.*$//;
-
- next if ($line =~ m/^\s*$/);
- if (rfc822_valid($line)) {
- push(@ignore_emails, $line);
+my @ignore_files = which_confs(".get_maintainer.ignore");
+foreach my $ignore_file (@ignore_files) {
+ if (-f $ignore_file) {
+ open(my $ignore, '<', "$ignore_file")
+ or warn "$P: Can't find a readable .get_maintainer.ignore file $!\n";
+ while (<$ignore>) {
+ my $line = $_;
+
+ $line =~ s/\s*\n?$//;
+ $line =~ s/^\s*//;
+ $line =~ s/\s+$//;
+ $line =~ s/#.*$//;
+
+ next if ($line =~ m/^\s*$/);
+ if (rfc822_valid($line)) {
+ push(@ignore_emails, $line);
+ }
}
+ close($ignore);
}
- close($ignore);
}
if (!GetOptions(
@@ -1237,15 +1239,26 @@ sub which {
return "";
}
-sub which_conf {
+sub which_confs {
my ($conf) = @_;
+ my @confs = ();
foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) {
if (-e "$path/$conf") {
- return "$path/$conf";
+ push(@confs, "$path/$conf");
}
}
+ return @confs;
+}
+
+sub which_conf {
+ my @confs = which_confs(@_);
+
+ if (@confs) {
+ return $confs[0];
+ }
+
return "";
}
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] get_maintainer: apply all .get_maintainer.ignore files
2017-04-05 11:30 [PATCH] get_maintainer: apply all .get_maintainer.ignore files Jeffy Chen
@ 2017-04-05 16:06 ` Joe Perches
2017-04-06 1:16 ` jeffy
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2017-04-05 16:06 UTC (permalink / raw)
To: Jeffy Chen, linux-kernel; +Cc: briannorris, dianders
On Wed, 2017-04-05 at 19:30 +0800, Jeffy Chen wrote:
> Currently we are searching "./:$ENV{HOME}/:.scripts/" for ignore file,
> but would always get "./.get_maintainer.ignore" only.
That's the point.
It allows you to have specific .ignore files for various projects.
> This patch applies all .get_maintainer.ignore, so it would be easier to
> add ignore list locally.
Why stack? What's the value in that?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] get_maintainer: apply all .get_maintainer.ignore files
2017-04-05 16:06 ` Joe Perches
@ 2017-04-06 1:16 ` jeffy
2017-04-06 1:21 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: jeffy @ 2017-04-06 1:16 UTC (permalink / raw)
To: Joe Perches, linux-kernel; +Cc: briannorris, dianders
Hi Joe,
On 04/06/2017 12:06 AM, Joe Perches wrote:
> On Wed, 2017-04-05 at 19:30 +0800, Jeffy Chen wrote:
>> Currently we are searching "./:$ENV{HOME}/:.scripts/" for ignore file,
>> but would always get "./.get_maintainer.ignore" only.
>
> That's the point.
>
> It allows you to have specific .ignore files for various projects.
yes, but we now have a .get_maintainer.ignore tracked in kernel's git
repository:
kernel# git log --oneline .get_maintainer.ignore
e525293 Add hch to .get_maintainer.ignore
so if we wanna modify the ignore list locally, we would have to do it
every time reset the repository.
>
>> This patch applies all .get_maintainer.ignore, so it would be easier to
>> add ignore list locally.
>
> Why stack? What's the value in that?
>
i found some mail server(for example chinese 263) would refuse to send
mails when any of the addresses are invalid. so i need to add them to
the ignore list(for example Yakir Yang <ykk@rock-chips.com>).
i think it would be good if we can provide a way to modify local ignore
list without affecting the repository.
or maybe i should just send my ignore file upstream?
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] get_maintainer: apply all .get_maintainer.ignore files
2017-04-06 1:16 ` jeffy
@ 2017-04-06 1:21 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-04-06 1:21 UTC (permalink / raw)
To: jeffy, linux-kernel; +Cc: briannorris, dianders
On Thu, 2017-04-06 at 09:16 +0800, jeffy wrote:
> maybe i should just send my ignore file upstream?
Probably a better idea.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-06 1:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 11:30 [PATCH] get_maintainer: apply all .get_maintainer.ignore files Jeffy Chen
2017-04-05 16:06 ` Joe Perches
2017-04-06 1:16 ` jeffy
2017-04-06 1:21 ` Joe Perches
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.