[xen master] get_maintainers.pl: Avoid THE_REST when files are added or removed

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] get_maintainers.pl: Avoid THE_REST when files are added or removed

patchbot
commit 140ddf18a6ec9f3e956696816af6640bbfd5283d
Author:     Alan Robinson <[hidden email]>
AuthorDate: Fri Feb 23 14:24:56 2018 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Fri Feb 23 14:24:56 2018 +0100

    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.
   
    Signed-off-by: Alan Robinson <[hidden email]>
    Acked-by: Ian Jackson <[hidden email]>
---
 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 0ce2d36..3fb1ad4 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) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog