diff options
author | Joe Perches <joe@perches.com> | 2011-07-25 20:13:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:15 -0400 |
commit | 0334b3824e671c28737074ca9fb0723ef05d9b9e (patch) | |
tree | 77733610795851bc0914aa634e30905dcac88cca /scripts | |
parent | 626a0312514a121a90b4478cbde111ffc6826ae2 (diff) |
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-x | scripts/get_maintainer.pl | 9 |
1 files changed, 5 insertions, 4 deletions
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 { | |||
328 | # name1 <mail1> <mail2> | 328 | # name1 <mail1> <mail2> |
329 | # name1 <mail1> name2 <mail2> | 329 | # name1 <mail1> name2 <mail2> |
330 | # (see man git-shortlog) | 330 | # (see man git-shortlog) |
331 | if (/^(.+)<(.+)>$/) { | 331 | |
332 | if (/^([^<]+)<([^>]+)>$/) { | ||
332 | my $real_name = $1; | 333 | my $real_name = $1; |
333 | my $address = $2; | 334 | my $address = $2; |
334 | 335 | ||
@@ -336,13 +337,13 @@ sub read_mailmap { | |||
336 | ($real_name, $address) = parse_email("$real_name <$address>"); | 337 | ($real_name, $address) = parse_email("$real_name <$address>"); |
337 | $mailmap->{names}->{$address} = $real_name; | 338 | $mailmap->{names}->{$address} = $real_name; |
338 | 339 | ||
339 | } elsif (/^<([^\s]+)>\s*<([^\s]+)>$/) { | 340 | } elsif (/^<([^>]+)>\s*<([^>]+)>$/) { |
340 | my $real_address = $1; | 341 | my $real_address = $1; |
341 | my $wrong_address = $2; | 342 | my $wrong_address = $2; |
342 | 343 | ||
343 | $mailmap->{addresses}->{$wrong_address} = $real_address; | 344 | $mailmap->{addresses}->{$wrong_address} = $real_address; |
344 | 345 | ||
345 | } elsif (/^(.+)<([^\s]+)>\s*<([^\s]+)>$/) { | 346 | } elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) { |
346 | my $real_name = $1; | 347 | my $real_name = $1; |
347 | my $real_address = $2; | 348 | my $real_address = $2; |
348 | my $wrong_address = $3; | 349 | my $wrong_address = $3; |
@@ -353,7 +354,7 @@ sub read_mailmap { | |||
353 | $mailmap->{names}->{$wrong_address} = $real_name; | 354 | $mailmap->{names}->{$wrong_address} = $real_name; |
354 | $mailmap->{addresses}->{$wrong_address} = $real_address; | 355 | $mailmap->{addresses}->{$wrong_address} = $real_address; |
355 | 356 | ||
356 | } elsif (/^(.+)<([^\s]+)>\s*([^\s].*)<([^\s]+)>$/) { | 357 | } elsif (/^(.+)<([^>]+)>\s*(.+)\s*<([^>]+)>$/) { |
357 | my $real_name = $1; | 358 | my $real_name = $1; |
358 | my $real_address = $2; | 359 | my $real_address = $2; |
359 | my $wrong_name = $3; | 360 | my $wrong_name = $3; |