# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
-our $GIT = "/home/build/bin/git";
+our $GIT = "/usr/bin/git";
# absolute fs-path which will be prepended to the project path
#our $projectroot = "/pub/scm";
our $logo_url = "http://git-scm.com/";
our $logo_label = "git homepage";
+# URI and label (title) of footer
+our $footer_url = "http://git-scm.com/";
+our $footer_label = "git homepage";
+
# source of projects list
our $projects_list = "";
}
} else {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
+ $year += 1900;
+ print "<div class=\"page_footer_text\">Copyright © $year, <a href=\"$footer_url\">$footer_label</a></div>\n";
+
print $cgi->a({-href => href(project=>undef, action=>"opml",
project_filter => $project_filter),
-class => $feed_class}, "OPML") . " ";
"</td>\n" .
"</tr>\n";
}
+
+ print '<tr><td colspan="'.($check_forks ? '1' : '2').'"> </td>';
+ print "<td>".($to + 1)." project".($to+1 >= 1 ? ($to+1 <= 1 ? "" : "s") : "")." found</td><td colspan=\"3\"> </td></tr>";
}
sub git_project_list_body {
sub git_shortlog_body {
# uses global variable $project
- my ($commitlist, $from, $to, $refs, $extra) = @_;
+ my ($commitlist, $from, $to, $refs, $extra, $file_name, $file_hash, $ftype, $allrefs) = @_;
$from = 0 unless defined $from;
$to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to);
- print "<table class=\"shortlog\">\n";
+ print "<table class=\"shortlog\" cellspacing=\"0\" cellpadding=\"0\">\n";
my $alternate = 1;
+
+ my $graph_rand = int(rand(99999));
+
+ my $head = git_get_head_hash($project);
+ my $graph_hash;
+
+ if (defined $allrefs && $allrefs == 1) {
+ $graph_hash = "all";
+ }
+ if (!defined $hash) {
+ $hash = $head;
+ }
+ if(!defined $graph_hash) {
+ $graph_hash = $hash;
+ }
+ if (!defined $page) {
+ $page = 0;
+ }
+
+ print "<tr class=\"header\">\n";
+ print "<td colspan=\"2\"><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$graph_hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=header\" /></td>\n";
+ print "<td valign=\"bottom\"><b>Author</b></td>\n";
+ print "<td valign=\"bottom\"><b>Commit</b></td>\n";
+ print "<td></td>\n";
+ print "</tr>\n";
+
for (my $i = $from; $i <= $to; $i++) {
my %co = %{$commitlist->[$i]};
my $commit = $co{'id'};
print "<tr class=\"light\">\n";
}
$alternate ^= 1;
+ print "<td><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$graph_hash.";from=".($from + (100 * $page)).";to=".($to + (100 * $page)).";c=".$commit."\" /></td>";
# git_summary() used print "<td><i>$co{'age_string'}</i></td>\n" .
- print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
+ print "<td class=\"". age_class($co{'age'}) . "\" title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
format_author_html('td', \%co, 10) . "<td>";
print format_subject_html($co{'title'}, $co{'title_short'},
href(action=>"commit", hash=>$commit), $ref);
print "<tr class=\"light\">\n";
}
$alternate ^= 1;
- print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
+ print "<td class=\"". age_class($co{'age'}) . "\" title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
# shortlog: format_author_html('td', \%co, 10)
format_author_html('td', \%co, 15, 3) . "<td>";
# originally git_history used chop_str($co{'title'}, 50)
$alternate ^= 1;
%co = parse_commit($set{'commit'});
my $author = chop_and_escape_str($co{'author_name'}, 15, 5);
- print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
+ print "<td class=\"". age_class($co{'age'}) . "\" title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
"<td><i>$author</i></td>\n" .
"<td>" .
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'}),
print "<tr class=\"light\">\n";
}
$alternate ^= 1;
- print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
+ print "<td class=\"". age_class($co{'age'}) . "\" title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
format_author_html('td', \%co, 15, 5) .
"<td>" .
$cgi->a({-href => href(action=>"commit", hash=>$co{'id'}),
# we need to request one more than 16 (0..15) to check if
# those 16 are all
- my @commitlist = $head ? parse_commits($head, 17) : ();
+ my @commitlist = $head ? parse_commits("--all", 17) : ();
if (@commitlist) {
git_print_header_div('shortlog');
git_shortlog_body(\@commitlist, 0, 15, $refs,
$#commitlist <= 15 ? undef :
- $cgi->a({-href => href(action=>"shortlog")}, "..."));
+ $cgi->a({-href => href(action=>"shortlog")}, "..."), 0, 0, 0, 1);
}
if (@taglist) {
}
sub git_log_generic {
- my ($fmt_name, $body_subr, $base, $parent, $file_name, $file_hash) = @_;
+ my ($fmt_name, $body_subr, $base, $parent, $file_name, $file_hash, $allrefs) = @_;
my $head = git_get_head_hash($project);
if (!defined $base) {
$base = $head;
+ $allrefs = 1;
}
if (!defined $page) {
$page = 0;
my $refs = git_get_references();
my $commit_hash = $base;
+ if (defined $allrefs) {
+ $commit_hash = "--all";
+ }
if (defined $parent) {
$commit_hash = "$parent..$base";
}
if (defined $file_name);
$body_subr->(\@commitlist, 0, 99, $refs, $next_link,
- $file_name, $file_hash, $ftype);
+ $file_name, $file_hash, $ftype, $allrefs);
git_footer_html();
}