All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan.Robinson@ts.fujitsu.com (Alan Robinson)
To: xen-devel@lists.xen.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 ] get_maintainers.pl: Avoid THE_REST when files are added or removed
Date: Thu, 22 Feb 2018 12:12:53 +0100	[thread overview]
Message-ID: <20180222111252.GA16659@ts.fujitsu.com> (raw)

When files are added or removed /dev/null is used as a place
holder name in the patch for the absent file.  Don't try and
find a MAINTAINER for this place holder, it only ever flags
and then spams THE REST, behaviour for a real filename is
unchanged.

Signed-off-by: Alan Robinson <Alan.Robinson@ts.fujitsu.com>
---
v1 - original version
v2 - addresses /dev/null and $lastfile comments from Jan

Tested by pretending to remove xen/common/cpupool.c for
which get_maintainers.pl currently flags 11 addresses, after
this patch only xen-devel and its two maintainers (Juergen and
Dario) get listed. 

Also tested adding a 'dev/null' file which get_maintainer.pl now
accepts and suggests 'THE_REST'.

 scripts/get_maintainer.pl | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 0ce2d367fa..3fb1ad4b69 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -444,10 +444,12 @@ foreach my $file (@ARGV) {
 	    my $patch_line = $_;
 	    if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
 		my $filename = $1;
-		$filename =~ s@^[^/]*/@@;
-		$filename =~ s@\n@@;
-		$lastfile = $filename;
-		push(@files, $filename);
+		if ($1 ne "/dev/null") { #Ignore the no-file placeholder
+		    $filename =~ s@^[^/]*/@@;
+		    $filename =~ s@\n@@;
+		    $lastfile = $filename;
+		    push(@files, $filename);
+		}
 		$patch_prefix = "^[+-].*";	#Now parsing the actual patch
 	    } elsif (m/^\@\@ -(\d+),(\d+)/) {
 		if ($email_git_blame) {
-- 
2.14.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2018-02-22 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 11:12 Alan Robinson [this message]
2018-02-23  9:53 ` [PATCH v2 ] get_maintainers.pl: Avoid THE_REST when files are added or removed Jan Beulich
2018-02-23 11:02 ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180222111252.GA16659@ts.fujitsu.com \
    --to=alan.robinson@ts.fujitsu.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.