- my @parents;
- my ($author, $author_time, $author_timezone);
- my ($committer, $committer_time, $committer_timezone);
- my $tree;
- my $comment;
- my $shortlog;
- open my $fd, "-|", "$gitbin/cat-file", "commit", $commit;
- while (my $line = <$fd>) {
- chomp($line);
- last if $line eq "";
- if ($line =~ m/^tree (.*)$/) {
- $tree = $1;
- } elsif ($line =~ m/^parent (.*)$/) {
- push @parents, $1;
- } elsif ($line =~ m/^committer (.*>) ([0-9]+) (.*)$/) {
- $committer = $1;
- $committer_time = $2;
- $committer_timezone = $3;
- } elsif ($line =~ m/^author (.*>) ([0-9]+) (.*)$/) {
- $author = $1;
- $author_time = $2;
- $author_timezone = $3;
- }
- }
- $shortlog = <$fd>;
- chomp($shortlog);
- $shortlog = escapeHTML($shortlog);
- $comment = $shortlog . "<br/>";
- while (my $line = <$fd>) {
- chomp($line);
- if ($line =~ m/signed-off-by:/i) {
- $comment .= '<div class="signed_off">' . escapeHTML($line) . "<br/></div>\n";
- } else {
- $comment .= escapeHTML($line) . "<br/>\n";
- }
- }
- close $fd;