The patch titled get_maintainer.pl: add support to match arbitrary text has been added to the -mm tree. Its filename is get_maintainerpl-add-support-to-match-arbitrary-text.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: get_maintainer.pl: add support to match arbitrary text From: L. Alberto Giménez <agimenez@xxxxxxxxxxx> Extend the usage of the K section in the MAINTAINERS file to support matching regular expressions with the content that precedes the patch (delimited by three dashes "---"). The change enables the get_maintainer.pl script to get maintainers based on arbitrary text that may precede the patch itself (for example, the commit message or mail headers generated by git-format-patch) Thanks to Jesper Juhl to point me that trivial patches should be CC'd to Jiri. The idea is that the get_maintainer.pl can detect such situations and add the additional email addresses and let the MAINTAINERS file handle who should get copies of what. Signed-off-by: L. Alberto Giménez <agimenez@xxxxxxxxxxx> Cc: Joe Perches <joe@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- MAINTAINERS | 1 + scripts/get_maintainer.pl | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff -puN MAINTAINERS~get_maintainerpl-add-support-to-match-arbitrary-text MAINTAINERS --- a/MAINTAINERS~get_maintainerpl-add-support-to-match-arbitrary-text +++ a/MAINTAINERS @@ -6157,6 +6157,7 @@ TRIVIAL PATCHES M: Jiri Kosina <trivial@xxxxxxxxxx> T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git S: Maintained +K: ^Subject:.*\[(?i)trivial\].* TTY LAYER M: Greg Kroah-Hartman <gregkh@xxxxxxx> diff -puN scripts/get_maintainer.pl~get_maintainerpl-add-support-to-match-arbitrary-text scripts/get_maintainer.pl --- a/scripts/get_maintainer.pl~get_maintainerpl-add-support-to-match-arbitrary-text +++ a/scripts/get_maintainer.pl @@ -420,6 +420,11 @@ foreach my $file (@ARGV) { open(my $patch, "< $file") or die "$P: Can't open $file: $!\n"; + + # We can add arbitrary information before the patch itself (commit message, + # mail headers,... This allows us to match arbitrary keywords agains any + # part of a git-format-patch generated file (subject tags, etc...) + my $in_patch = 0; while (<$patch>) { my $patch_line = $_; if (m/^\+\+\+\s+(\S+)/) { @@ -432,9 +437,14 @@ foreach my $file (@ARGV) { if ($email_git_blame) { push(@range, "$lastfile:$1:$2"); } + } elsif (not $in_patch and m/^---/) { + # enter "patch area": keywords matched only on changed lines + $in_patch = 1; } elsif ($keywords) { foreach my $line (keys %keyword_hash) { - if ($patch_line =~ m/^[+-].*$keyword_hash{$line}/x) { + my $change_hook = $in_patch ? "^[+-].*" : ""; + + if ($patch_line =~ m/^${change_hook}$keyword_hash{$line}/x) { push(@keyword_tvi, $line); } } _ Patches currently in -mm which might be from agimenez@xxxxxxxxxxx are get_maintainerpl-add-support-to-match-arbitrary-text.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html