get_maintainer: Improve patch recognition

There are mode change and rename only patches that are unrecognized
by the get_maintainer.pl script.

Recognize them.

[ Linux commit 0455c74788fd5aad4399f00e3fbbb7e87450ca58 ]

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
CC: Julien Grall <julien.grall@arm.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Joe Perches authored and Julien Grall committed 2019-07-09 15:15:24 +01:00
1 parent 9b1a31922a
commit cb2dd34b7b
1 file changed
+12 -1
+12 -1
View File
@@ -445,7 +445,18 @@ foreach my $file (@ARGV) {
while (<$patch>) { while (<$patch>) {
my $patch_line = $_; my $patch_line = $_;
if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) { if (m/^ mode change [0-7]+ => [0-7]+ (\S+)\s*$/) {
my $filename = $1;
push(@files, $filename);
} elsif (m/^rename (?:from|to) (\S+)\s*$/) {
my $filename = $1;
push(@files, $filename);
} elsif (m/^diff --git a\/(\S+) b\/(\S+)\s*$/) {
my $filename1 = $1;
my $filename2 = $2;
push(@files, $filename1);
push(@files, $filename2);
} elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
my $filename = $1; my $filename = $1;
if ($1 ne "/dev/null") { #Ignore the no-file placeholder if ($1 ne "/dev/null") { #Ignore the no-file placeholder
$filename =~ s@^[^/]*/@@; $filename =~ s@^[^/]*/@@;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.