binmode STDOUT, ':utf8';
my $cgi = new CGI;
-my $version = "258";
+my $version = "262";
my $my_url = $cgi->url();
my $my_uri = $cgi->url(-absolute => 1);
my $rss_link = "";
<title>$title</title>
$rss_link
<style type="text/css">
-body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
+body {
+ font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px;
+ margin:10px; background-color:#ffffff; color:#000000;
+}
a { color:#0000cc; }
a:hover, a:visited, a:active { color:#880000; }
div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
}
a.rss_logo:hover { background-color:#ee5500; }
span.tag {
- padding:0px 4px; font-size:10px;
+ padding:0px 4px; font-size:10px; font-weight:normal;
background-color:#ffffaa; border:1px solid; border-color:#ffffcc #ffee00 #ffee00 #ffffcc;
}
</style>
};
foreach my $title (@commit_lines) {
+ $title =~ s/^ //;
if ($title ne "") {
$co{'title'} = chop_str($title, 80, 5);
# remove leading stuff of merges to make the interesting part visible
}
sub read_info_ref {
+ my $type = shift || "";
my %refs;
# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11
# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}
open my $fd, "$projectroot/$project/info/refs" or return;
while (my $line = <$fd>) {
- if ($line =~ m/^([0-9a-fA-F]{40})\t.*\/([^\^]+)/) {
+ chomp($line);
+ if ($line =~ m/^([0-9a-fA-F]{40})\t.*$type\/([^\^]+)/) {
if (defined $refs{$1}) {
$refs{$1} .= " / $2";
} else {
}
$alternate ^= 1;
if ($i-- > 0) {
+ my $ref = "";
+ if (defined $refs->{$commit}) {
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
+ }
print "<td><i>$co{'age_string'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
"<td>";
if (length($co{'title_short'}) < length($co{'title'})) {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
- "<b>" . esc_html($co{'title_short'}) . "</b>");
+ "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
} else {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
- "<b>" . esc_html($co{'title'}) . "</b>");
- }
- if (defined $refs->{$commit}) {
- print " <span class=\"tag\">$refs->{$commit}</span>";
+ "<b>" . esc_html($co{'title'}) . "$ref</b>");
}
print "</td>\n" .
"<td class=\"link\">" .
close $fd or die_error(undef, "Reading tree failed.");
$/ = "\n";
+ my $refs = read_info_ref();
+ my $ref = "";
+ if (defined $refs->{$hash_base}) {
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$hash_base}) . "</span>";
+ }
git_header_html();
my $base_key = "";
my $base = "";
"<br/><br/>\n" .
"</div>\n";
print "<div>\n" .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
+ $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .
"</div>\n";
} else {
print "<div class=\"page_nav\">\n";
my $commit = $revlist[$i];
my $ref = "";
if (defined $refs->{$commit}) {
- $ref = " <span class=\"tag\">$refs->{$commit}</span>";
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
}
my %co = git_read_commit($commit);
next if !%co;
if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
$expires = "+1d";
}
+ my $refs = read_info_ref();
+ my $ref = "";
+ if (defined $refs->{$co{'id'}}) {
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$co{'id'}}) . "</span>";
+ }
git_header_html(undef, $expires);
print "<div class=\"page_nav\">\n" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, "summary") .
"<br/><br/></div>\n";
if (defined $co{'parent'}) {
print "<div>\n" .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash"), -class => "title"}, esc_html($co{'title'})) . "\n" .
+ $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .
"</div>\n";
} else {
print "<div>\n" .
if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
$expires = "+1d";
}
+ my $refs = read_info_ref();
+ my $ref = "";
+ if (defined $refs->{$co{'id'}}) {
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$co{'id'}}) . "</span>";
+ }
git_header_html(undef, $expires);
print "<div class=\"page_nav\">\n" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, "summary") .
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff_plain;h=$hash;hp=$hash_parent")}, "plain") . "\n" .
"</div>\n";
print "<div>\n" .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash"), -class => "title"}, esc_html($co{'title'})) . "\n" .
+ $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .
"</div>\n";
print "<div class=\"page_body\">\n";
my $comment = $co{'comment'};
# try to figure out the next tag after this commit
my $tagname;
- my $refs = read_info_ref();
+ my $refs = read_info_ref("tags");
open $fd, "-|", "$gitbin/git-rev-list HEAD";
chomp (my (@commits) = <$fd>);
close $fd;
"\n";
foreach my $line (@$comment) {;
- print " $line\n";
+ print "$line\n";
}
print "---\n\n";
}
my $ref = "";
if (defined $refs->{$commit}) {
- $ref = " <span class=\"tag\">$refs->{$commit}</span>";
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
}
if ($alternate) {
print "<tr class=\"dark\">\n";
print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
"<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"}, "<b>" .
- esc_html(chop_str($co{'title'}, 50)) . "</b>") . "$ref</td>\n" .
+ esc_html(chop_str($co{'title'}, 50)) . "$ref</b>") . "</td>\n" .
"<td class=\"link\">" .
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") .
" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") .
my $alternate = 0;
for (my $i = ($page * 100); $i <= $#revlist; $i++) {
my $commit = $revlist[$i];
+ my $ref = "";
+ if (defined $refs->{$commit}) {
+ $ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
+ }
my %co = git_read_commit($commit);
my %ad = date_str($co{'author_epoch'});
if ($alternate) {
"<td>";
if (length($co{'title_short'}) < length($co{'title'})) {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
- "<b>" . esc_html($co{'title_short'}) . "</b>");
+ "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
} else {
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"},
- "<b>" . esc_html($co{'title_short'}) . "</b>");
- }
- if (defined $refs->{$commit}) {
- print " <span class=\"tag\">$refs->{$commit}</span>";
+ "<b>" . esc_html($co{'title_short'}) . "$ref</b>");
}
print "</td>\n" .
"<td class=\"link\">" .