lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] get_maintainer: ignore "my" e-mail address
Date
Ignore one's own e-mail address given as a parameter to --ignore-me
or in the EMAIL environment variable.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
---
scripts/get_maintainer.pl | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index ff10c2878522..0719d575c682 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -42,6 +42,7 @@ my $email_git_max_maintainers = 5;
my $email_git_min_percent = 5;
my $email_git_since = "1-year-ago";
my $email_hg_since = "-365";
+my $email_ignore_me = undef;
my $interactive = 0;
my $email_remove_duplicates = 1;
my $email_use_mailmap = 1;
@@ -251,6 +252,7 @@ if (!GetOptions(
'git-since=s' => \$email_git_since,
'hg-since=s' => \$email_hg_since,
'i|interactive!' => \$interactive,
+ 'ignore-me:s' => \$email_ignore_me,
'remove-duplicates!' => \$email_remove_duplicates,
'mailmap!' => \$email_use_mailmap,
'm!' => \$email_maintainer,
@@ -338,6 +340,17 @@ if ($tree && !top_of_kernel_tree($lk_path)) {
. "a linux kernel source tree.\n";
}

+if (defined $email_ignore_me) {
+ if ($email_ignore_me && rfc822_valid($email_ignore_me)) {
+ (undef, $email_ignore_me) = parse_email($email_ignore_me);
+ } elsif (!$email_ignore_me && defined $ENV{EMAIL} && rfc822_valid($ENV{EMAIL})) {
+ (undef, $email_ignore_me) = parse_email($ENV{EMAIL});
+ } else {
+ warn "$P: \"$email_ignore_me\" is not a valid e-mail address\n";
+ $email_ignore_me = 0;
+ }
+}
+
## Read MAINTAINERS for type/value pairs

my @typevalue = ();
@@ -1062,6 +1075,8 @@ MAINTAINER field selection options:
--rolestats => show roles and statistics (commits/total_commits, %)
--file-emails => add email addresses found in -f file (default: 0 (off))
--fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on))
+ --ignore-me => ignore one's own e-mail address passed as a parameter or
+ via EMAIL environment variable
--scm => print SCM tree(s) if any
--status => print status if any
--subsystem => print subsystem name if any
@@ -1401,6 +1416,11 @@ sub push_email_address {
return 0;
}

+ if ($email_ignore_me) {
+ my ($myname, $myaddr) = parse_email($email_ignore_me);
+ return 0 if ($address eq $myaddr)
+ }
+
if (!$email_remove_duplicates) {
push(@email_to, [format_email($name, $address, $email_usename), $role]);
} elsif (!email_inuse($name, $address)) {
--
2.30.2
\
 
 \ /
  Last update: 2021-11-16 22:35    [W:0.107 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site