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\" cellspacing=\"0\" cellpadding=\"0\">\n";
my $alternate = 1;
+ my $head = git_get_head_hash($project);
+ if (defined $allrefs && $allrefs == 1) {
+ $hash = "all";
+ }
+ if (!defined $hash) {
+ $hash = $head;
+ }
+ if (!defined $page) {
+ $page = 0;
+ }
my $graph_rand = int(rand(99999));
+ print "<tr class=\"header\">\n";
+ print "<td colspan=\"2\"><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$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'};
- my $head = git_get_head_hash($project);
- if (!defined $hash) {
- $hash = $head;
- }
- if (!defined $page) {
- $page = 0;
- }
-
my $ref = format_ref_marker($refs, $commit);
if ($alternate) {
print "<tr class=\"dark\">\n";
# 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) {
my ($fmt_name, $body_subr, $base, $parent, $file_name, $file_hash) = @_;
my $head = git_get_head_hash($project);
+ my $allrefs;
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();
}
+++ /dev/null
---- index.cgi 2012-08-29 01:30:10 +0000
-+++ index-graph.cgi 2012-09-07 19:06:10 +0000
-@@ -4764,13 +4768,33 @@
-
- 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);
-+ if (defined $allrefs && $allrefs == 1) {
-+ $hash = "all";
-+ }
-+ if (!defined $hash) {
-+ $hash = $head;
-+ }
-+ 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=".$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'};
-@@ -4781,6 +4805,7 @@
- print "<tr class=\"light\">\n";
- }
- $alternate ^= 1;
-+ print "<td><img class=\"graph\" src=\"git_graph.php?r=".$graph_rand.";p=".$project.";h=".$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" .
- format_author_html('td', \%co, 10) . "<td>";
-@@ -5167,12 +5194,12 @@
-
- # 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) {
-@@ -5847,8 +5874,10 @@
- my ($fmt_name, $body_subr, $base, $parent, $file_name, $file_hash) = @_;
-
- my $head = git_get_head_hash($project);
-+ my $allrefs;
- if (!defined $base) {
- $base = $head;
-+ $allrefs = 1;
- }
- if (!defined $page) {
- $page = 0;
-@@ -5856,7 +5885,10 @@
- my $refs = git_get_references();
-
- my $commit_hash = $base;
-- if (defined $parent) {
-+ if (defined $allrefs) {
-+ $commit_hash = "--all";
-+ }
-+ if (defined $parent) {
- $commit_hash = "$parent..$base";
- }
- my @commitlist =
-@@ -5912,7 +5944,7 @@
- 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();
- }