+} elsif ($action eq "history") {
+ if (!(defined($hash))) {
+ $hash = git_head($project);
+ }
+ open my $fd, "-|", "$gitbin/git-rev-list $hash";
+ my (@revlist) = map { chomp; $_ } <$fd>;
+ close $fd;
+
+ git_header_html();
+ print "<div class=\"page_nav\">\n";
+ print "<br/><br/></div>\n";
+ print "<div class=\"title\">". escapeHTML($file_name) . "</div>\n";
+ print "<div class=\"page_body\">\n" .
+ "<br/>\n" .
+ "</div>\n";
+ foreach my $rev (@revlist) {
+ my %co = git_commit($rev);
+ my $parents = $co{'parents'};
+ my $found = 0;
+ foreach my $parent (@$parents) {
+ open $fd, "-|", "$gitbin/git-diff-tree -r $parent $rev $file_name";
+ my (@difftree) = map { chomp; $_ } <$fd>;
+ close $fd;
+
+ foreach my $line (@difftree) {
+ $line =~ m/^(.)(.*)\t(.*)\t(.*)\t(.*)$/;
+ my $file = $5;
+ if ($file eq $file_name) {
+ $found = 1;
+ last;
+ }
+ }
+ }
+ if ($found) {
+ print "<div class=\"list\">\n" .
+ $co{'age_string'} . "" . $co{'title'} . "\n" .
+ "</div>";
+ print "<div class=\"link\">\n" .
+ "view " .
+ $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$rev"}, "commit") . " | " .
+ $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$rev"}, "tree") . "<br/><br/>\n" .
+ "</div>\n";
+ }
+ }
+ git_footer_html();