From: Joe Perches Date: Tue, 26 Jul 2011 00:13:13 +0000 (-0700) Subject: get_maintainers.pl: improve .mailmap parsing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0334b3824e671c28737074ca9fb0723ef05d9b9e;p=openwrt%2Fstaging%2Fblogic.git get_maintainers.pl: improve .mailmap parsing Entries that used formats other than "Proper Name " were not parsed properly. Try to improve the parsing so that the entries in the forms of: Proper Name and Proper Name Commit Name are transformed correctly. Signed-off-by: Joe Perches Reviewed-by: Florian Mickler Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index d29a8d75cb22..eb2f1e64edf7 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -328,7 +328,8 @@ sub read_mailmap { # name1 # name1 name2 # (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;