From: Andy Whitcroft Date: Thu, 13 Dec 2007 06:58:15 +0000 (+0000) Subject: git-svn: expand handling of From: and Signed-off-by: X-Git-Tag: v1.5.4-rc1~74 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5ff6aae8951268d8287337b1875bccae267d2b56;p=git.git 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 Expand this to include the raw email addresses and straight "names": From: email@address -> email From: Full Name -> Full Name Signed-off-by: Andy Whitcroft Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- diff --git a/git-svn.perl b/git-svn.perl index 54d784469..34c5e3d2e 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2363,11 +2363,20 @@ sub make_log_entry { my ($commit_name, $commit_email) = ($name, $email); if ($_use_log_author) { - if ($log_entry{log} =~ /From:\s+(.*?)\s+<(.*)>\s*\n/) { - ($name, $email) = ($1, $2); - } elsif ($log_entry{log} =~ - /Signed-off-by:\s+(.*?)\s+<(.*)>\s*\n/) { + my $name_field; + if ($log_entry{log} =~ /From:\s+(.*\S)\s*\n/i) { + $name_field = $1; + } elsif ($log_entry{log} =~ /Signed-off-by:\s+(.*\S)\s*\n/i) { + $name_field = $1; + } + if (!defined $name_field) { + # + } elsif ($name_field =~ /(.*?)\s+<(.*)>/) { ($name, $email) = ($1, $2); + } elsif ($name_field =~ /(.*)@/) { + ($name, $email) = ($1, $name_field); + } else { + ($name, $email) = ($name_field, 'unknown'); } } if (defined $headrev && $self->use_svm_props) {