diff mbox series

get_maintainer: Improve patch recognition

Message ID 20190529113534.23213-1-volodymyr_babchuk@epam.com (mailing list archive)
State Superseded
Headers show
Series get_maintainer: Improve patch recognition | expand

Commit Message

Volodymyr Babchuk May 29, 2019, 11:35 a.m. UTC
From: Joe Perches <joe@perches.com>

From: Joe Perches <joe@perches.com>

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

Recognize them.

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>
---
 scripts/get_maintainer.pl | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Jan Beulich May 29, 2019, 11:46 a.m. UTC | #1
>>> On 29.05.19 at 13:35, <Volodymyr_Babchuk@epam.com> wrote:
> From: Joe Perches <joe@perches.com>
> 
> From: Joe Perches <joe@perches.com>
> 
> There are mode change and rename only patches that are unrecognized
> by the get_maintainer.pl script.
> 
> Recognize them.
> 
> 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>

Mentioning the original Linux commit ID would have been nice.

Jan
Volodymyr Babchuk May 29, 2019, 11:52 a.m. UTC | #2
Hi Jan,

Jan Beulich writes:

>>>> On 29.05.19 at 13:35, <Volodymyr_Babchuk@epam.com> wrote:
>> From: Joe Perches <joe@perches.com>
>> 
>> From: Joe Perches <joe@perches.com>
>> 
>> There are mode change and rename only patches that are unrecognized
>> by the get_maintainer.pl script.
>> 
>> Recognize them.
>>

 [ Upstream 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>
>
> Mentioning the original Linux commit ID would have been nice.
Oh, thank you. This is the first time I'm porting the patch from
the other tree.
Jan Beulich May 29, 2019, 12:03 p.m. UTC | #3
>>> On 29.05.19 at 13:52, <Volodymyr_Babchuk@epam.com> wrote:
> Jan Beulich writes:
>>>>> On 29.05.19 at 13:35, <Volodymyr_Babchuk@epam.com> wrote:
>>> From: Joe Perches <joe@perches.com>
>>> 
>>> From: Joe Perches <joe@perches.com>
>>> 
>>> There are mode change and rename only patches that are unrecognized
>>> by the get_maintainer.pl script.
>>> 
>>> Recognize them.
>>>
> 
>  [ Upstream commit 0455c74788fd5aad4399f00e3fbbb7e87450ca58 ]

s/Upstream/Linux/, but thanks.

Jan
diff mbox series

Patch

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index d528da738c..174dfb7e40 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -445,7 +445,18 @@  foreach my $file (@ARGV) {
 
 	while (<$patch>) {
 	    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;
 		if ($1 ne "/dev/null") { #Ignore the no-file placeholder
 		    $filename =~ s@^[^/]*/@@;