Skip to contentSkip to conversation

get_maintainers.pl: Avoid THE_REST when files are added or removed

PATCH In review Alan Robinson 3 participants 3 messages Feb 22, 2018 – Feb 23, 2018 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 get_maintainers.pl: Avoid THE_REST when files are added or removed

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.

---
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(-)
scripts/get_maintainer.pl +6 -4
index 0ce2d367fa..3fb1ad4b69 100755
@@ -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) {
Signature · 6 lines
2.14.1

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 22.02.18 at 12:12, <[email protected]> wrote:

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.

FTR - looks fine to me, but I wouldn't want to put this in without someone with more Perl knowledge having given their okay.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v2 1/1
#2 lore raw
In reply to Alan Robinson

Alan Robinson writes ("[PATCH v2 ] get_maintainers.pl: Avoid THE_REST when files are added or removed"):

Quoted 5 lines

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.

I have reviewed (but not tested) the Perl and it LGTM.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel