From patchwork Tue Sep 20 14:26:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 76611 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1517883qgf; Tue, 20 Sep 2016 07:29:58 -0700 (PDT) X-Received: by 10.194.45.232 with SMTP id q8mr28912056wjm.9.1474381798295; Tue, 20 Sep 2016 07:29:58 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 14si7175262wmn.119.2016.09.20.07.29.58; Tue, 20 Sep 2016 07:29:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 21B734B9F9; Tue, 20 Sep 2016 16:29:51 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xQlgxv9rfXEc; Tue, 20 Sep 2016 16:29:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16B7E4BA16; Tue, 20 Sep 2016 16:29:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8CFF4B660 for ; Tue, 20 Sep 2016 16:28:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id faCL36ioxXkA for ; Tue, 20 Sep 2016 16:28:40 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bear.ext.ti.com (bear.ext.ti.com [198.47.19.11]) by theia.denx.de (Postfix) with ESMTPS id 107BF4B656 for ; Tue, 20 Sep 2016 16:28:37 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8KEQHTS012257; Tue, 20 Sep 2016 09:26:17 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8KEQHW7001523; Tue, 20 Sep 2016 09:26:17 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Tue, 20 Sep 2016 09:26:15 -0500 Received: from [128.247.83.101] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8KEQFO3007705; Tue, 20 Sep 2016 09:26:15 -0500 To: References: <1473829386-374-1-git-send-email-hs@denx.de> <569ce190-4053-9af0-7664-d73f01289bac@ti.com> <57E0CE2E.70900@denx.de> From: "Andrew F. Davis" Message-ID: <0492d23b-6d21-f0de-af51-897b68d91e29@ti.com> Date: Tue, 20 Sep 2016 09:26:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <57E0CE2E.70900@denx.de> X-Mailman-Approved-At: Tue, 20 Sep 2016 16:29:42 +0200 Cc: Ben Whitten , Lucas Stach , Matthias Fuchs , Raphael Assenat , Samuel Egli , Chin-Liang See , "Albert ARIBAUD \(3ADEV\)" , u-boot@lists.denx.de, Stefan Roese , Dave Purdy , Eric Jarrige , Luka Perkov , Roger Meier , Stephen Warren , Holger Brunck , Tony Dinh , Viresh Kumar , Stefan Agner , Valentin Longchamp , Thomas Weber , Siddarth Gore , Eric Cooper , Carlos Hernandez , egnite GmbH , Peter Howard , Kyungmin Park , Pavel Machek , Lauri Hintsala , Purna Chandra Mandal , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Fabio Estevam , =?UTF-8?Q?David_M=c3=bcller?= , Tom Rini Subject: Re: [U-Boot] [RFC PATCH] kconfig: introduce kconfig for UBI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On 09/20/2016 12:50 AM, Heiko Schocher wrote: > Hello Andrew, > > Am 19.09.2016 um 18:03 schrieb Andrew F. Davis: >> BTW, the following addresses that bounce should be removed from wherever >> you found them or added to .get_maintainer.ignore if they are part of >> old commits: >> >> Bo Shen >> Albert ARIBAUD >> Gerald Kerma >> Karl Beldan >> Vaibhav Hiremath >> Sudhakar Rajashekhara >> > > Hmm.. I used patman for creating the patch and so patman created with > the help of scripts/get_maintainer.pl creates the cc list ... > It seems most of these are from MAINTAINER files, these names need to be removed and their subsystem status changed to unmaintained until new maintainers can step up. > I just tried to create such a ".get_maintainer.ignore" file, but > doesn;t work ... ah, I see, the get_maintainer.pl from U-Boot does > not support the ".get_maintainer.ignore" file > > Hmm.. looked into it, not easy (for me) to fix this "fast" ... > Looks like the scripts/get_maintainer.pl needs to be synced with the Linux version, something like: --- >From b9a032c6e33cfe59f9d2cd6d0901bf588aad3b5f Mon Sep 17 00:00:00 2001 From: "Andrew F. Davis" Date: Tue, 20 Sep 2016 07:59:58 -0500 Subject: [PATCH] get_maintainer.pl: Sync with latest version from Linux Signed-off-by: Andrew F. Davis --- scripts/get_maintainer.pl | 188 ++++++++++++++++++++++++++++++---------------- 1 file changed, 125 insertions(+), 63 deletions(-) --n => include name 'Full Name ' --l => include list(s) if any --s => include subscriber only list(s) if any @@ -794,7 +817,7 @@ Other options: --help => show this help information Default options: - [--email --nogit --git-fallback --m --n --l --multiline -pattern-depth=0 + [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0 --remove-duplicates --rolestats] Notes: @@ -826,6 +849,9 @@ Notes: Entries in this file can be any command line argument. This file is prepended to any additional command line arguments. Multiple lines and # comments are allowed. + Most options have both positive and negative forms. + The negative forms for -- are --no and --no-. + EOT } @@ -954,20 +980,29 @@ sub find_ending_index { return $index; } -sub get_maintainer_role { +sub get_subsystem_name { my ($index) = @_; - my $i; my $start = find_starting_index($index); - my $end = find_ending_index($index); - my $role = "unknown"; my $subsystem = $typevalue[$start]; - if (length($subsystem) > 20) { - $subsystem = substr($subsystem, 0, 17); + if ($output_section_maxlen && length($subsystem) > $output_section_maxlen) { + $subsystem = substr($subsystem, 0, $output_section_maxlen - 3); $subsystem =~ s/\s*$//; $subsystem = $subsystem . "..."; } + return $subsystem; +} + +sub get_maintainer_role { + my ($index) = @_; + + my $i; + my $start = find_starting_index($index); + my $end = find_ending_index($index); + + my $role = "unknown"; + my $subsystem = get_subsystem_name($index); for ($i = $start + 1; $i < $end; $i++) { my $tv = $typevalue[$i]; @@ -1001,16 +1036,7 @@ sub get_maintainer_role { sub get_list_role { my ($index) = @_; - my $i; - my $start = find_starting_index($index); - my $end = find_ending_index($index); - - my $subsystem = $typevalue[$start]; - if (length($subsystem) > 20) { - $subsystem = substr($subsystem, 0, 17); - $subsystem =~ s/\s*$//; - $subsystem = $subsystem . "..."; - } + my $subsystem = get_subsystem_name($index); if ($subsystem eq "THE REST") { $subsystem = ""; @@ -1084,6 +1110,23 @@ sub add_categories { my $role = get_maintainer_role($i); push_email_addresses($pvalue, $role); } + } elsif ($ptype eq "R") { + my ($name, $address) = parse_email($pvalue); + if ($name eq "") { + if ($i > 0) { + my $tv = $typevalue[$i - 1]; + if ($tv =~ m/^([A-Z]):\s*(.*)/) { + if ($1 eq "P") { + $name = $2; + $pvalue = format_email($name, $address, $email_usename); + } + } + } + } + if ($email_reviewer) { + my $subsystem = get_subsystem_name($i); + push_email_addresses($pvalue, "reviewer:$subsystem"); + } } elsif ($ptype eq "T") { push(@scm, $pvalue); } elsif ($ptype eq "W") { @@ -1868,6 +1911,7 @@ sub vcs_assign { my $percent = $sign_offs * 100 / $divisor; $percent = 100 if ($percent > 100); + next if (ignore_email_address($line)); $count++; last if ($sign_offs < $email_git_min_signatures || $count > $email_git_max_maintainers || @@ -2082,6 +2126,24 @@ sub vcs_file_blame { } } +sub vcs_file_exists { + my ($file) = @_; + + my $exists; + + my $vcs_used = vcs_exists(); + return 0 if (!$vcs_used); + + my $cmd = $VCS_cmds{"file_exists_cmd"}; + $cmd =~ s/(\$\w+)/$1/eeg; # interpolate $cmd + $cmd .= " 2>&1"; + $exists = &{$VCS_cmds{"execute_cmd"}}($cmd); + + return 0 if ($? != 0); + + return $exists; +} + sub uniq { my (@parms) = @_; -- 2.9.3 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 83a4e5b..edcccff 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -16,12 +16,14 @@ my $P = $0; my $V = '0.26'; use Getopt::Long qw(:config no_auto_abbrev); -use File::Find; +use Cwd; +my $cur_path = fastgetcwd() . '/'; my $lk_path = "./"; my $email = 1; my $email_usename = 1; my $email_maintainer = 1; +my $email_reviewer = 1; my $email_list = 1; my $email_subscriber_list = 0; my $email_git_penguin_chiefs = 0; @@ -42,6 +44,7 @@ my $output_multiline = 1; my $output_separator = ", "; my $output_roles = 0; my $output_rolestats = 1; +my $output_section_maxlen = 50; my $scm = 0; my $web = 0; my $subsystem = 0; @@ -128,6 +131,7 @@ my %VCS_cmds_git = ( "author_pattern" => "^GitAuthor: (.*)", "subject_pattern" => "^GitSubject: (.*)", "stat_pattern" => "^(\\d+)\\t(\\d+)\\t\$file\$", + "file_exists_cmd" => "git ls-files \$file", ); my %VCS_cmds_hg = ( @@ -156,6 +160,7 @@ my %VCS_cmds_hg = ( "author_pattern" => "^HgAuthor: (.*)", "subject_pattern" => "^HgSubject: (.*)", "stat_pattern" => "^(\\d+)\t(\\d+)\t\$file\$", + "file_exists_cmd" => "hg files \$file", ); my $conf = which_conf(".get_maintainer.conf"); @@ -184,6 +189,27 @@ if (-f $conf) { unshift(@ARGV, @conf_args) if @conf_args; } +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); + } + } + close($ignore); +} + if (!GetOptions( 'email!' => \$email, 'git!' => \$email_git, @@ -201,6 +227,7 @@ if (!GetOptions( 'remove-duplicates!' => \$email_remove_duplicates, 'mailmap!' => \$email_use_mailmap, 'm!' => \$email_maintainer, + 'r!' => \$email_reviewer, 'n!' => \$email_usename, 'l!' => \$email_list, 's!' => \$email_subscriber_list, @@ -259,7 +286,8 @@ if ($sections) { } if ($email && - ($email_maintainer + $email_list + $email_subscriber_list + + ($email_maintainer + $email_reviewer + + $email_list + $email_subscriber_list + $email_git + $email_git_penguin_chiefs + $email_git_blame) == 0) { die "$P: Please select at least 1 email option\n"; } @@ -274,53 +302,34 @@ if (!top_of_kernel_tree($lk_path)) { my @typevalue = (); my %keyword_hash; -my @maint_files = (); -push(@maint_files, "${lk_path}MAINTAINERS"); - -sub maint_wanted { - return unless $_ =~ /^MAINTAINERS/; - push(@maint_files, "$File::Find::name"); -} - -File::Find::find(\&maint_wanted, "${lk_path}board"); - -foreach my $maint_file (@maint_files) { - my $maint; - open ($maint, '<', "$maint_file") - or die "$P: Can't open $maint_file: $!\n"; - read_maintainers($maint); - close($maint); -} - -sub read_maintainers { - my ($maint) = @_; - - while (<$maint>) { - my $line = $_; - - if ($line =~ m/^([A-Z]):\s*(.*)/) { - my $type = $1; - my $value = $2; - - ##Filename pattern matching - if ($type eq "F" || $type eq "X") { - $value =~ s@\.@\\\.@g; ##Convert . to \. - $value =~ s/\*/\.\*/g; ##Convert * to .* - $value =~ s/\?/\./g; ##Convert ? to . - ##if pattern is a directory and it lacks a trailing slash, add one - if ((-d $value)) { - $value =~ s@([^/])$@$1/@; - } - } elsif ($type eq "K") { - $keyword_hash{@typevalue} = $value; +open (my $maint, '<', "${lk_path}MAINTAINERS") + or die "$P: Can't open MAINTAINERS: $!\n"; +while (<$maint>) { + my $line = $_; + + if ($line =~ m/^([A-Z]):\s*(.*)/) { + my $type = $1; + my $value = $2; + + ##Filename pattern matching + if ($type eq "F" || $type eq "X") { + $value =~ s@\.@\\\.@g; ##Convert . to \. + $value =~ s/\*/\.\*/g; ##Convert * to .* + $value =~ s/\?/\./g; ##Convert ? to . + ##if pattern is a directory and it lacks a trailing slash, add one + if ((-d $value)) { + $value =~ s@([^/])$@$1/@; } - push(@typevalue, "$type:$value"); - } elsif (!/^(\s)*$/) { - $line =~ s/\n$//g; - push(@typevalue, $line); + } elsif ($type eq "K") { + $keyword_hash{@typevalue} = $value; } + push(@typevalue, "$type:$value"); + } elsif (!/^(\s)*$/) { + $line =~ s/\n$//g; + push(@typevalue, $line); } } +close($maint); # @@ -421,7 +430,9 @@ foreach my $file (@ARGV) { die "$P: file '${file}' not found\n"; } } - if ($from_filename) { + if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) { + $file =~ s/^\Q${cur_path}\E//; #strip any absolute path + $file =~ s/^\Q${lk_path}\E//; #or the path to the lk tree push(@files, $file); if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) { open(my $f, '<', $file) @@ -528,6 +539,16 @@ if ($web) { exit($exit); +sub ignore_email_address { + my ($address) = @_; + + foreach my $ignore (@ignore_emails) { + return 1 if ($ignore eq $address); + } + + return 0; +} + sub range_is_maintained { my ($start, $end) = @_; @@ -764,10 +785,12 @@ MAINTAINER field selection options: --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers) --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent) --git-blame => use git blame to find modified commits for patch or file + --git-blame-signatures => when used with --git-blame, also include all commit signers --git-since => git history to use (default: $email_git_since) --hg-since => hg history to use (default: $email_hg_since) --interactive => display a menu (mostly useful if used with the --git option) --m => include maintainer(s) if any + --r => include reviewer(s) if any