|
@@ -420,6 +420,14 @@ foreach my $file (@ARGV) {
|
|
|
|
|
|
open(my $patch, "< $file")
|
|
open(my $patch, "< $file")
|
|
or die "$P: Can't open $file: $!\n";
|
|
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>) {
|
|
while (<$patch>) {
|
|
my $patch_line = $_;
|
|
my $patch_line = $_;
|
|
if (m/^\+\+\+\s+(\S+)/) {
|
|
if (m/^\+\+\+\s+(\S+)/) {
|
|
@@ -428,13 +436,14 @@ foreach my $file (@ARGV) {
|
|
$filename =~ s@\n@@;
|
|
$filename =~ s@\n@@;
|
|
$lastfile = $filename;
|
|
$lastfile = $filename;
|
|
push(@files, $filename);
|
|
push(@files, $filename);
|
|
|
|
+ $patch_prefix = "^[+-].*"; #Now parsing the actual patch
|
|
} elsif (m/^\@\@ -(\d+),(\d+)/) {
|
|
} elsif (m/^\@\@ -(\d+),(\d+)/) {
|
|
if ($email_git_blame) {
|
|
if ($email_git_blame) {
|
|
push(@range, "$lastfile:$1:$2");
|
|
push(@range, "$lastfile:$1:$2");
|
|
}
|
|
}
|
|
} elsif ($keywords) {
|
|
} elsif ($keywords) {
|
|
foreach my $line (keys %keyword_hash) {
|
|
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);
|
|
push(@keyword_tvi, $line);
|
|
}
|
|
}
|
|
}
|
|
}
|