gitweb: use git_print_authorship_rows in 'tag' view too
parse_tag must be adapted to use the hash keys expected by git_print_authorship_rows. This is not a problem since git_tag is the only user of this sub. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Giuseppe Bilotta committed
Jun 30, 2009 at 00:00 UTC
ba9247339dfbd2c2671603e012d011b4b474fa4b
1 file changed
+9
-7
gitweb/gitweb.perl
+9
-7
@@ -2409,8 +2409,14 @@ sub parse_tag {
2409
$tag{'name'} = $1;
2410
} elsif ($line =~ m/^tagger (.*) ([0-9]+) (.*)$/) {
2411
$tag{'author'} = $1;
2412
- $tag{'epoch'} = $2;
2413
- $tag{'tz'} = $3;
2412
+ $tag{'author_epoch'} = $2;
2413
+ $tag{'author_tz'} = $3;
2414
+ if ($tag{'author'} =~ m/^([^<]+) <([^>]*)>/) {
2415
+ $tag{'author_name'} = $1;
2416
+ $tag{'author_email'} = $2;
2417
+ } else {
2418
+ $tag{'author_name'} = $tag{'author'};
2419
+ }
2420
} elsif ($line =~ m/--BEGIN/) {
2421
push @comment, $line;
2422
last;
@@ -4620,11 +4626,7 @@ sub git_tag {
4626
$tag{'type'}) . "</td>\n" .
4627
"</tr>\n";
4628
if (defined($tag{'author'})) {
4623
- my %ad = parse_date($tag{'epoch'}, $tag{'tz'});
4624
- print "<tr><td>author</td><td>" . esc_html($tag{'author'}) . "</td></tr>\n";
4625
- print "<tr><td></td><td>" . $ad{'rfc2822'} .
4626
- sprintf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'}) .
4627
- "</td></tr>\n";
4629
+ git_print_authorship_rows(\%tag, 'author');
4630
}
4631
print "</table>\n\n" .
4632
"</div>\n";