summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-03-23 02:34:24 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 03:44:13 +0300
commit7764dcb53473e5665ab3cdc461ccfc510fce925e (patch)
treee839911d1d15cbd066477b13dfeea2e3f2ff1446 /scripts
parent5af5bcb8d37f99ba415a1adc6da71051b84f93a5 (diff)
downloadlinux-7764dcb53473e5665ab3cdc461ccfc510fce925e.tar.xz
get_maintainer.pl: allow "K:" pattern tests to match non-patch text
Extend the usage of the K section in the MAINTAINERS file to support matching regular expressions to any arbitrary text that may precede the patch itself. For example, the commit message or mail headers generated by git-format-patch. Signed-off-by: Joe Perches <joe@perches.com> Original-patch-by: L. Alberto Giménez <agimenez@sysvalve.es> Acked-by: L. Alberto Giménez <agimenez@sysvalve.es> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get_maintainer.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 139e0fff8e31..d29a8d75cb22 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -420,6 +420,14 @@ foreach my $file (@ARGV) {
open(my $patch, "< $file")
or die "$P: Can't open $file: $!\n";
+
+ # We can check arbitrary information before the patch
+ # like the commit message, mail headers, etc...
+ # This allows us to match arbitrary keywords against any part
+ # of a git format-patch generated file (subject tags, etc...)
+
+ my $patch_prefix = ""; #Parsing the intro
+
while (<$patch>) {
my $patch_line = $_;
if (m/^\+\+\+\s+(\S+)/) {
@@ -428,13 +436,14 @@ foreach my $file (@ARGV) {
$filename =~ s@\n@@;
$lastfile = $filename;
push(@files, $filename);
+ $patch_prefix = "^[+-].*"; #Now parsing the actual patch
} elsif (m/^\@\@ -(\d+),(\d+)/) {
if ($email_git_blame) {
push(@range, "$lastfile:$1:$2");
}
} elsif ($keywords) {
foreach my $line (keys %keyword_hash) {
- if ($patch_line =~ m/^[+-].*$keyword_hash{$line}/x) {
+ if ($patch_line =~ m/${patch_prefix}$keyword_hash{$line}/x) {
push(@keyword_tvi, $line);
}
}