From: Stricted Date: Fri, 7 Sep 2012 19:43:09 +0000 (+0200) Subject: sync index.cgi with the changes from pk910 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=748674085f0fc8e2c1f60cba840cd1d5ff454966;p=gitweb.git sync index.cgi with the changes from pk910 --- diff --git a/git_graph.php b/git_graph.php index 5f660a0..689b851 100644 --- a/git_graph.php +++ b/git_graph.php @@ -1,13 +1,8 @@ >>>>>> remotes/origin2/master $size = 20; $header_height = false; //false = dynamic diff --git a/index.cgi b/index.cgi index 8485a90..4a45d83 100644 --- a/index.cgi +++ b/index.cgi @@ -4773,26 +4773,34 @@ sub git_log_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 "\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 "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\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 "\n"; @@ -5261,12 +5269,12 @@ sub git_summary { # 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) { @@ -5941,8 +5949,10 @@ sub git_log_generic { 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; @@ -5950,6 +5960,9 @@ sub git_log_generic { my $refs = git_get_references(); my $commit_hash = $base; + if (defined $allrefs) { + $commit_hash = "--all"; + } if (defined $parent) { $commit_hash = "$parent..$base"; } @@ -6006,7 +6019,7 @@ sub git_log_generic { 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(); } diff --git a/patch/gitweb.cgi.diff b/patch/gitweb.cgi.diff deleted file mode 100644 index d7ad041..0000000 --- a/patch/gitweb.cgi.diff +++ /dev/null @@ -1,93 +0,0 @@ ---- 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 "
AuthorCommit
\n"; -+ print "
\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 "\n"; -+ print "\n"; -+ print "\n"; -+ print "\n"; -+ print "\n"; -+ print "\n"; -+ - for (my $i = $from; $i <= $to; $i++) { - my %co = %{$commitlist->[$i]}; - my $commit = $co{'id'}; -@@ -4781,6 +4805,7 @@ - print "\n"; - } - $alternate ^= 1; -+ print ""; - # git_summary() used print "\n" . - print "\n" . - format_author_html('td', \%co, 10) . "
AuthorCommit
$co{'age_string'}$co{'age_string_date'}"; -@@ -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(); - }