+ git_footer_html();
+}
+
+sub git_tags {
+ my $head = git_read_hash("$project/HEAD");
+ git_header_html();
+ print "<div class=\"page_nav\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;hb=$head"}, "tree") . "<br/>\n" .
+ "<br/>\n" .
+ "</div>\n";
+ my $taglist = git_read_refs("refs/tags");
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, " ") .
+ "</div>\n";
+ print "<table cellspacing=\"0\">\n";
+ my $alternate = 0;
+ if (defined @$taglist) {
+ foreach my $entry (@$taglist) {
+ my %tag = %$entry;
+ my $comment_lines = $tag{'comment'};
+ my $comment = shift @$comment_lines;
+ if (defined($comment)) {
+ $comment = chop_str($comment, 30, 5);
+ }
+ if ($alternate) {
+ print "<tr class=\"dark\">\n";
+ } else {
+ print "<tr class=\"light\">\n";
+ }
+ $alternate ^= 1;
+ print "<td><i>$tag{'age'}</i></td>\n" .
+ "<td>" .
+ $cgi->a({-href => "$my_uri?p=$project;a=$tag{'reftype'};h=$tag{'refid'}", -class => "list"},
+ "<b>" . escapeHTML($tag{'name'}) . "</b>") .
+ "</td>\n" .
+ "<td>";
+ if (defined($comment)) {
+ print $cgi->a({-class => "list", -href => "$my_uri?p=$project;a=tag;h=$tag{'id'}"}, $comment);
+ }
+ print "</td>\n" .
+ "<td class=\"link\">";
+ if ($tag{'type'} eq "tag") {
+ print $cgi->a({-href => "$my_uri?p=$project;a=tag;h=$tag{'id'}"}, "tag") . " | ";
+ }
+ print $cgi->a({-href => "$my_uri?p=$project;a=$tag{'reftype'};h=$tag{'refid'}"}, $tag{'reftype'});
+ if ($tag{'reftype'} eq "commit") {
+ print " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$tag{'name'}"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'refid'}"}, "log");
+ }
+ print "</td>\n" .
+ "</tr>";
+ }
+ }
+ print "</table\n>";
+ git_footer_html();
+}
+
+sub git_heads {
+ my $head = git_read_hash("$project/HEAD");
+ git_header_html();
+ print "<div class=\"page_nav\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;hb=$head"}, "tree") . "<br/>\n" .
+ "<br/>\n" .
+ "</div>\n";
+ my $taglist = git_read_refs("refs/heads");
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, " ") .
+ "</div>\n";
+ print "<table cellspacing=\"0\">\n";
+ my $alternate = 0;
+ if (defined @$taglist) {
+ foreach my $entry (@$taglist) {
+ my %tag = %$entry;
+ if ($alternate) {
+ print "<tr class=\"dark\">\n";
+ } else {
+ print "<tr class=\"light\">\n";
+ }
+ $alternate ^= 1;
+ print "<td><i>$tag{'age'}</i></td>\n" .
+ "<td>" .
+ $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$tag{'name'}", -class => "list"}, "<b>" . escapeHTML($tag{'name'}) . "</b>") .
+ "</td>\n" .
+ "<td class=\"link\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$tag{'name'}"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'name'}"}, "log") .
+ "</td>\n" .
+ "</tr>";
+ }
+ }
+ print "</table\n>";
+ git_footer_html();
+}
+
+sub git_get_hash_by_path {
+ my $base = shift;
+ my $path = shift || return undef;
+
+ my $tree = $base;
+ my @parts = split '/', $path;
+ while (my $part = shift @parts) {
+ open my $fd, "-|", "$gitbin/git-ls-tree $tree" or die_error(undef, "Open git-ls-tree failed.");
+ my (@entries) = map { chomp; $_ } <$fd>;
+ close $fd or return undef;
+ foreach my $line (@entries) {
+ #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
+ $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/;
+ my $t_mode = $1;
+ my $t_type = $2;
+ my $t_hash = $3;
+ my $t_name = $4;
+ if ($t_name eq $part) {
+ if (!(@parts)) {
+ return $t_hash;
+ }
+ if ($t_type eq "tree") {
+ $tree = $t_hash;
+ }
+ last;
+ }
+ }
+ }
+}
+
+sub git_blob {
+ if (!defined $hash && defined $file_name) {
+ my $base = $hash_base || git_read_hash("$project/HEAD");
+ $hash = git_get_hash_by_path($base, $file_name, "blob");
+ }
+ open my $fd, "-|", "$gitbin/git-cat-file blob $hash" or die_error(undef, "Open failed.");
+ git_header_html();
+ if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
+ print "<div class=\"page_nav\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree") . "<br/>\n";
+ if (defined $file_name) {
+ print $cgi->a({-href => "$my_uri?p=$project;a=blob_plain;h=$hash;f=$file_name"}, "plain") . "<br/>\n";
+ } else {
+ print $cgi->a({-href => "$my_uri?p=$project;a=blob_plain;h=$hash"}, "plain") . "<br/>\n";
+ }
+ print "</div>\n".
+ "<div>" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML($co{'title'})) .
+ "</div>\n";
+ } else {
+ print "<div class=\"page_nav\">\n" .
+ "<br/><br/></div>\n" .
+ "<div class=\"title\">$hash</div>\n";
+ }
+ if (defined $file_name) {
+ print "<div class=\"page_path\"><b>$file_name</b></div>\n";
+ }
+ print "<div class=\"page_body\">\n";
+ my $nr;
+ while (my $line = <$fd>) {
+ chomp $line;
+ $nr++;
+ while ((my $pos = index($line, "\t")) != -1) {
+ if (my $count = (8 - ($pos % 8))) {
+ my $spaces = ' ' x $count;
+ $line =~ s/\t/$spaces/;
+ }
+ }
+ printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n", $nr, $nr, $nr, escapeHTML($line);
+ }
+ close $fd or print "Reading blob failed.\n";
+ print "</div>";
+ git_footer_html();
+}
+
+sub git_blob_plain {
+ my $save_as = "$hash.txt";
+ if (defined $file_name) {
+ $save_as = $file_name;
+ }
+ print $cgi->header(-type => "text/plain", -charset => 'utf-8', '-content-disposition' => "inline; filename=\"$save_as\"");
+ open my $fd, "-|", "$gitbin/git-cat-file blob $hash" or return;
+ undef $/;
+ print <$fd>;
+ $/ = "\n";
+ close $fd;
+}
+
+sub git_tree {
+ if (!defined $hash) {
+ $hash = git_read_hash("$project/HEAD");
+ if (defined $file_name) {
+ my $base = $hash_base || git_read_hash("$project/HEAD");
+ $hash = git_get_hash_by_path($base, $file_name, "tree");
+ }
+ if (!defined $hash_base) {
+ $hash_base = git_read_hash("$project/HEAD");
+ }
+ }
+ open my $fd, "-|", "$gitbin/git-ls-tree $hash" or die_error(undef, "Open git-ls-tree failed.");
+ my (@entries) = map { chomp; $_ } <$fd>;
+ close $fd or die_error(undef, "Reading tree failed.");
+
+ git_header_html();
+ my $base_key = "";
+ my $file_key = "";
+ my $base = "";
+ if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
+ $base_key = ";hb=$hash_base";
+ print "<div class=\"page_nav\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash_base"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash_base"}, "log") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
+ " | tree" .
+ "<br/><br/>\n" .
+ "</div>\n";
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
+ "</div>\n";
+ } else {
+ print "<div class=\"page_nav\">\n";
+ print "<br/><br/></div>\n";
+ print "<div class=\"title\">$hash</div>\n";
+ }
+ if (defined $file_name) {
+ $base = "$file_name/";
+ print "<div class=\"page_path\"><b>/$file_name</b></div>\n";
+ } else {
+ print "<div class=\"page_path\"><b>/</b></div>\n";
+ }
+ print "<div class=\"page_body\">\n";
+ print "<table cellspacing=\"0\">\n";
+ my $alternate = 0;
+ foreach my $line (@entries) {
+ #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
+ $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/;
+ my $t_mode = $1;
+ my $t_type = $2;
+ my $t_hash = $3;
+ my $t_name = $4;
+ $file_key = ";f=$base$t_name";
+ if ($alternate) {
+ print "<tr class=\"dark\">\n";
+ } else {
+ print "<tr class=\"light\">\n";
+ }
+ $alternate ^= 1;
+ print "<td style=\"font-family:monospace\">" . mode_str($t_mode) . "</td>\n";
+ if ($t_type eq "blob") {
+ print "<td class=\"list\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=blob;h=$t_hash" . $base_key . $file_key, -class => "list"}, $t_name) .
+ "</td>\n" .
+ "<td class=\"link\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=blob;h=$t_hash" . $base_key . $file_key}, "blob") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=history;h=$hash_base" . $file_key}, "history") .
+ "</td>\n";
+ } elsif ($t_type eq "tree") {
+ print "<td class=\"list\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key}, $t_name) .
+ "</td>\n" .
+ "<td class=\"link\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key}, "tree") .
+ "</td>\n";
+ }
+ print "</tr>\n";
+ }
+ print "</table>\n" .
+ "</div>";
+ git_footer_html();
+}
+
+sub git_rss {
+ # http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
+ open my $fd, "-|", "$gitbin/git-rev-list --max-count=150 " . git_read_hash("$project/HEAD") or die_error(undef, "Open failed.");
+ my (@revlist) = map { chomp; $_ } <$fd>;
+ close $fd or die_error(undef, "Reading rev-list failed.");
+ print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
+ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
+ "<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n";
+ print "<channel>\n";
+ print "<title>$project</title>\n".
+ "<link>" . escapeHTML("$my_url?p=$project;a=summary") . "</link>\n".
+ "<description>$project log</description>\n".
+ "<language>en</language>\n";
+
+ for (my $i = 0; $i <= $#revlist; $i++) {
+ my $commit = $revlist[$i];
+ my %co = git_read_commit($commit);
+ # we read 150, we always show 30 and the ones more recent than 48 hours
+ if (($i >= 20) && ((time - $co{'committer_epoch'}) > 48*60*60)) {
+ last;
+ }
+ my %cd = date_str($co{'committer_epoch'});
+ open $fd, "-|", "$gitbin/git-diff-tree -r $co{'parent'} $co{'id'}" or next;
+ my @difftree = map { chomp; $_ } <$fd>;
+ close $fd or next;
+ print "<item>\n" .
+ "<title>" .
+ sprintf("%d %s %02d:%02d", $cd{'mday'}, $cd{'month'}, $cd{'hour'}, $cd{'minute'}) . " - " . escapeHTML($co{'title'}) .
+ "</title>\n" .
+ "<author>" . escapeHTML($co{'author'}) . "</author>\n" .
+ "<pubDate>$cd{'rfc2822'}</pubDate>\n" .
+ "<guid isPermaLink=\"true\">" . escapeHTML("$my_url?p=$project;a=commit;h=$commit") . "</guid>\n" .
+ "<link>" . escapeHTML("$my_url?p=$project;a=commit;h=$commit") . "</link>\n" .
+ "<description>" . escapeHTML($co{'title'}) . "</description>\n" .
+ "<content:encoded>" .
+ "<![CDATA[\n";
+ my $comment = $co{'comment'};
+ foreach my $line (@$comment) {
+ print "$line<br/>\n";
+ }
+ print "<br/>\n";
+ foreach my $line (@difftree) {
+ if (!($line =~ m/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$/)) {
+ next;
+ }
+ my $file = $7;
+ print "$file<br/>\n";
+ }
+ print "]]>\n" .
+ "</content:encoded>\n" .
+ "</item>\n";
+ }
+ print "</channel></rss>";
+}
+
+sub git_opml {
+ my @list = git_read_projects();
+
+ print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
+ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
+ "<opml version=\"1.0\">\n".
+ "<head>".
+ " <title>Git OPML Export</title>\n".
+ "</head>\n".
+ "<body>\n".
+ "<outline text=\"git RSS feeds\">\n";
+
+ foreach my $pr (@list) {
+ my %proj = %$pr;
+ my $head = git_read_hash("$proj{'path'}/HEAD");
+ if (!defined $head) {
+ next;
+ }
+ $ENV{'GIT_DIR'} = "$projectroot/$proj{'path'}";
+ my %co = git_read_commit($head);
+ if (!%co) {
+ next;
+ }
+
+ my $path = escapeHTML(chop_str($proj{'path'}, 25, 5));
+ my $rss = "$my_url?p=$proj{'path'};a=rss";
+ my $html = "$my_url?p=$proj{'path'};a=summary";
+ print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
+ }
+ print "</outline>\n".
+ "</body>\n".
+ "</opml>\n";
+}
+
+sub git_log {
+ my $head = git_read_hash("$project/HEAD");
+ if (!defined $hash) {
+ $hash = $head;
+ }
+ if (!defined $page) {
+ $page = 0;
+ }
+ git_header_html();
+ print "<div class=\"page_nav\">\n";
+ print $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash"}, "shortlog") .
+ " | log" .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$hash;hb=$hash"}, "tree") . "<br/>\n";
+
+ my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
+ open my $fd, "-|", "$gitbin/git-rev-list $limit $hash" or die_error(undef, "Open failed.");
+ my (@revlist) = map { chomp; $_ } <$fd>;
+ close $fd;
+
+ if ($hash ne $head || $page) {
+ print $cgi->a({-href => "$my_uri?p=$project;a=log"}, "HEAD");
+ } else {
+ print "HEAD";
+ }
+ if ($page > 0) {
+ print " ⋅ " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash;pg=" . ($page-1), -accesskey => "p", -title => "Alt-p"}, "prev");
+ } else {
+ print " ⋅ prev";
+ }
+ if ($#revlist >= (100 * ($page+1)-1)) {
+ print " ⋅ " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash;pg=" . ($page+1), -accesskey => "n", -title => "Alt-n"}, "next");
+ } else {
+ print " ⋅ next";
+ }
+ print "<br/>\n" .
+ "</div>\n";
+ if (!@revlist) {
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, " ") .
+ "</div>\n";
+ my %co = git_read_commit($hash);
+ print "<div class=\"page_body\"> Last change $co{'age_string'}.<br/><br/></div>\n";
+ }
+ for (my $i = ($page * 100); $i <= $#revlist; $i++) {
+ my $commit = $revlist[$i];
+ my %co = git_read_commit($commit);
+ next if !%co;
+ my %ad = date_str($co{'author_epoch'});
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "title"},
+ "<span class=\"age\">$co{'age_string'}</span>" . escapeHTML($co{'title'})) . "\n" .
+ "</div>\n";
+ print "<div class=\"title_text\">\n" .
+ "<div class=\"log_link\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .
+ "<br/>\n" .
+ "</div>\n" .
+ "<i>" . escapeHTML($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
+ "</div>\n" .
+ "<div class=\"log_body\">\n";
+ my $comment = $co{'comment'};
+ my $empty = 0;
+ foreach my $line (@$comment) {
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ next;
+ }
+ if ($line eq "") {
+ if ($empty) {
+ next;
+ }
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ if (!$empty) {
+ print "<br/>\n";
+ }
+ print "</div>\n";
+ }
+ git_footer_html();
+}
+
+sub git_commit {
+ my %co = git_read_commit($hash);
+ if (!%co) {
+ die_error(undef, "Unknown commit object.");
+ }
+ my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
+ my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
+
+ my @difftree;
+ my $root = "";
+ my $parent = $co{'parent'};
+ if (!defined $parent) {
+ $root = " --root";
+ $parent = "";
+ }
+ open my $fd, "-|", "$gitbin/git-diff-tree -r -M $root $parent $hash" or die_error(undef, "Open failed.");
+ @difftree = map { chomp; $_ } <$fd>;
+ close $fd or die_error(undef, "Reading diff-tree failed.");
+ git_header_html();
+ print "<div class=\"page_nav\">\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash"}, "shortlog") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash"}, "log") .
+ " | commit";
+ if (defined $co{'parent'}) {
+ print " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff");
+ }
+ print " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") . "\n" .
+ "<br/><br/></div>\n";
+ if (defined $co{'parent'}) {
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
+ "</div>\n";
+ } else {
+ print "<div>\n" .
+ $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
+ "</div>\n";
+ }
+ print "<div class=\"title_text\">\n" .
+ "<table cellspacing=\"0\">\n";
+ print "<tr><td>author</td><td>" . escapeHTML($co{'author'}) . "</td></tr>\n".
+ "<tr>" .
+ "<td></td><td> $ad{'rfc2822'}";
+ if ($ad{'hour_local'} < 6) {
+ printf(" (<span style=\"color: #cc0000;\">%02d:%02d</span> %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
+ } else {
+ printf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
+ }
+ print "</td>" .
+ "</tr>\n";
+ print "<tr><td>committer</td><td>" . escapeHTML($co{'committer'}) . "</td></tr>\n";
+ print "<tr><td></td><td> $cd{'rfc2822'}" . sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) . "</td></tr>\n";
+ print "<tr><td>commit</td><td style=\"font-family:monospace\">$co{'id'}</td></tr>\n";
+ print "<tr>" .
+ "<td>tree</td>" .
+ "<td style=\"font-family:monospace\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash", class => "list"}, $co{'tree'}) .
+ "</td>" .
+ "<td class=\"link\">" . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") .
+ "</td>" .
+ "</tr>\n";
+ my $parents = $co{'parents'};
+ foreach my $par (@$parents) {
+ print "<tr>" .
+ "<td>parent</td>" .
+ "<td style=\"font-family:monospace\">" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$par", class => "list"}, $par) . "</td>" .
+ "<td class=\"link\">" .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$par"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash;hp=$par"}, "commitdiff") .
+ "</td>" .
+ "</tr>\n";
+ }
+ print "</table>".
+ "</div>\n";