summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-07-25 17:13:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:15 -0700
commit0334b3824e671c28737074ca9fb0723ef05d9b9e (patch)
tree77733610795851bc0914aa634e30905dcac88cca /scripts
parent626a0312514a121a90b4478cbde111ffc6826ae2 (diff)
downloadop-kernel-dev-0334b3824e671c28737074ca9fb0723ef05d9b9e.zip
op-kernel-dev-0334b3824e671c28737074ca9fb0723ef05d9b9e.tar.gz
get_maintainers.pl: improve .mailmap parsing
Entries that used formats other than "Proper Name <commit@email.xx>" were not parsed properly. Try to improve the parsing so that the entries in the forms of: Proper Name <proper@email.xx> <commit@email.xx> and Proper Name <proper@email.xx> Commit Name <commit@email.xx> are transformed correctly. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Florian Mickler <florian@mickler.org> 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.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index d29a8d7..eb2f1e6 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -328,7 +328,8 @@ sub read_mailmap {
# name1 <mail1> <mail2>
# name1 <mail1> name2 <mail2>
# (see man git-shortlog)
- if (/^(.+)<(.+)>$/) {
+
+ if (/^([^<]+)<([^>]+)>$/) {
my $real_name = $1;
my $address = $2;
@@ -336,13 +337,13 @@ sub read_mailmap {
($real_name, $address) = parse_email("$real_name <$address>");
$mailmap->{names}->{$address} = $real_name;
- } elsif (/^<([^\s]+)>\s*<([^\s]+)>$/) {
+ } elsif (/^<([^>]+)>\s*<([^>]+)>$/) {
my $real_address = $1;
my $wrong_address = $2;
$mailmap->{addresses}->{$wrong_address} = $real_address;
- } elsif (/^(.+)<([^\s]+)>\s*<([^\s]+)>$/) {
+ } elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) {
my $real_name = $1;
my $real_address = $2;
my $wrong_address = $3;
@@ -353,7 +354,7 @@ sub read_mailmap {
$mailmap->{names}->{$wrong_address} = $real_name;
$mailmap->{addresses}->{$wrong_address} = $real_address;
- } elsif (/^(.+)<([^\s]+)>\s*([^\s].*)<([^\s]+)>$/) {
+ } elsif (/^(.+)<([^>]+)>\s*(.+)\s*<([^>]+)>$/) {
my $real_name = $1;
my $real_address = $2;
my $wrong_name = $3;
OpenPOWER on IntegriCloud