From: Jakub Narebski Date: Sat, 25 Nov 2006 14:54:32 +0000 (+0100) Subject: gitweb: Add author and committer email extraction to parse_commit X-Git-Tag: v1.5.0-rc0~218^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ba00b8c1edafcc414cfe13f8a4addac3893c2a29;p=git.git gitweb: Add author and committer email extraction to parse_commit Extract author email to 'author_email' key, and comitter mail to 'committer_mail' key; uniquify committer and author lines handling by the way. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 26fc3a689..85a896b61 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1294,8 +1294,9 @@ sub parse_commit { $co{'author'} = $1; $co{'author_epoch'} = $2; $co{'author_tz'} = $3; - if ($co{'author'} =~ m/^([^<]+) ]*)>/) { + $co{'author_name'} = $1; + $co{'author_email'} = $2; } else { $co{'author_name'} = $co{'author'}; } @@ -1304,7 +1305,12 @@ sub parse_commit { $co{'committer_epoch'} = $2; $co{'committer_tz'} = $3; $co{'committer_name'} = $co{'committer'}; - $co{'committer_name'} =~ s/ <.*//; + if ($co{'committer'} =~ m/^([^<]+) <([^>]*)>/) { + $co{'committer_name'} = $1; + $co{'committer_email'} = $2; + } else { + $co{'committer_name'} = $co{'committer'}; + } } } if (!defined $co{'tree'}) {