- if ($action eq "log") {
- if ($time_back > 0 && $co{'age'} > $time_back*60*60*24) {
- if ($i == 0) {
- print "<div class=\"page_body\"> Last change " . $co{'age_string'} . ".<br/><br/></div>\n";
- }
- last;
- }
- print "<div>\n" .
- $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "title"},
- "<span class=\"log_age\">" . $co{'age_string'} . "</span>" . escapeHTML($co{'title'})) . "\n" .
- "</div>\n";
- print "<div class=\"title2\">\n" .
- "<div class=\"log_link\">\n" .
- "view " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") . " | " .
- $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "diff") . "<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'};
- foreach my $line (@$comment) {
- last if ($line =~ m/^(signed-off|acked)-by:/i);
- print escapeHTML($line) . "<br/>\n";
+ print "<item>\n" .
+ "\t<title>" . sprintf("%d %s %02d:%02d", $ad{'mday'}, $ad{'month'}, $ad{'hour'}, $ad{'minute'}) . " - " . escapeHTML($co{'title'}) . "</title>\n" .
+ "\t<link> " . $my_url . "?p=$project;a=commit;h=$commit</link>\n" .
+ "\t<description>";
+ my $comment = $co{'comment'};
+ foreach my $line (@$comment) {
+ print escapeHTML($line) . "<br/>\n";
+ }
+ print "\t</description>\n" .
+ "</item>\n";
+ }
+ print "</channel></rss>";
+}
+
+sub git_log {
+ my $head = git_read_head($project);
+ my $limit_option = "";
+ if (!defined $time_back) {
+ $limit_option = "--max-count=10";
+ } elsif ($time_back > 0) {
+ my $date = time - $time_back*24*60*60;
+ $limit_option = "--max-age=$date";
+ }
+ open my $fd, "-|", "$gitbin/git-rev-list $limit_option $head" || die_error(undef, "Open failed.");
+ my (@revlist) = map { chomp; $_ } <$fd>;
+ close $fd || die_error(undef, "Reading rev-list failed.");
+
+ git_header_html();
+ print "<div class=\"page_nav\">\n";
+ print "view ";
+ print $cgi->a({-href => "$my_uri?p=$project;a=log"}, "last 10") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;t=1"}, "day") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;t=7"}, "week") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;t=31"}, "month") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;t=365"}, "year") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=log;t=0"}, "all") . "<br/>\n";
+ print "<br/><br/>\n" .
+ "</div>\n";
+
+ if (!@revlist) {
+ my %co = git_read_commit($head);
+ print "<div class=\"page_body\"> Last change " . $co{'age_string'} . ".<br/><br/></div>\n";
+ }
+
+ foreach my $commit (@revlist) {
+ 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=\"log_age\">" . $co{'age_string'} . "</span>" . escapeHTML($co{'title'})) . "\n" .
+ "</div>\n";
+ print "<div class=\"title_text\">\n" .
+ "<div class=\"log_link\">\n" .
+ "view " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
+ " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "diff") .
+ "<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|acked).by/i) {
+ next;