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-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/b3fa569fa2c65abaf6a84043079af7fff8286a590057b51abe883e7bdd63e654 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.perl b/gitweb.perl index 0fac8e2..6e727c8 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1295,8 +1295,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'}; } @@ -1305,7 +1306,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'}) {