@matheusbsbs / matheus-bagliano / commits / 5ff6aae895
Fork 0

git-svn: expand handling of From: and Signed-off-by:

The current parsing for From: and Signed-off-by: lines handles fully specified names: From: Full Name <email@address> Expand this to include the raw email addresses and straight "names": From: email@address -> email <email@address> From: Full Name -> Full Name <unknown> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Andy Whitcroft committed Dec 13, 2007 at 06:58 UTC 5ff6aae8951268d8287337b1875bccae267d2b56
1 file changed +13 -4
git-svn.perl
+13 -4
@@ -2363,11 +2363,20 @@ sub make_log_entry {
2363
2364 my ($commit_name, $commit_email) = ($name, $email);
2365 if ($_use_log_author) {
2366 - if ($log_entry{log} =~ /From:\s+(.*?)\s+<(.*)>\s*\n/) {
2367 - ($name, $email) = ($1, $2);
2368 - } elsif ($log_entry{log} =~
2369 - /Signed-off-by:\s+(.*?)\s+<(.*)>\s*\n/) {
2366 + my $name_field;
2367 + if ($log_entry{log} =~ /From:\s+(.*\S)\s*\n/i) {
2368 + $name_field = $1;
2369 + } elsif ($log_entry{log} =~ /Signed-off-by:\s+(.*\S)\s*\n/i) {
2370 + $name_field = $1;
2371 + }
2372 + if (!defined $name_field) {
2373 + #
2374 + } elsif ($name_field =~ /(.*?)\s+<(.*)>/) {
2375 ($name, $email) = ($1, $2);
2376 + } elsif ($name_field =~ /(.*)@/) {
2377 + ($name, $email) = ($1, $name_field);
2378 + } else {
2379 + ($name, $email) = ($name_field, 'unknown');
2380 }
2381 }
2382 if (defined $headrev && $self->use_svm_props) {