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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jakub Narebski 2006-11-25 15:54:32 +01:00 коммит произвёл Junio C Hamano
Родитель 28b9d9f7c6
Коммит ba00b8c1ed
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -1294,8 +1294,9 @@ sub parse_commit {
$co{'author'} = $1; $co{'author'} = $1;
$co{'author_epoch'} = $2; $co{'author_epoch'} = $2;
$co{'author_tz'} = $3; $co{'author_tz'} = $3;
if ($co{'author'} =~ m/^([^<]+) </) { if ($co{'author'} =~ m/^([^<]+) <([^>]*)>/) {
$co{'author_name'} = $1; $co{'author_name'} = $1;
$co{'author_email'} = $2;
} else { } else {
$co{'author_name'} = $co{'author'}; $co{'author_name'} = $co{'author'};
} }
@ -1304,7 +1305,12 @@ sub parse_commit {
$co{'committer_epoch'} = $2; $co{'committer_epoch'} = $2;
$co{'committer_tz'} = $3; $co{'committer_tz'} = $3;
$co{'committer_name'} = $co{'committer'}; $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'}) { if (!defined $co{'tree'}) {