From 56e01928e37297b9cfe5ed9db8f1c00a8ef4aea2 Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Wed, 3 Jul 2019 17:02:03 +0200 Subject: [PATCH] apply gitweb changes Change-Id: I8287706610aa37bcb73f78cdf8875027e4c10bb6 --- index.cgi | 64 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/index.cgi b/index.cgi index b76e0fc..6dd340e 100644 --- a/index.cgi +++ b/index.cgi @@ -80,7 +80,7 @@ sub evaluate_uri { # 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"; @@ -127,6 +127,10 @@ our $javascript = "static/gitweb.js"; 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 = ""; @@ -4256,6 +4260,10 @@ sub git_footer_html { } } else { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; + $year += 1900; + print "\n"; + print $cgi->a({-href => href(project=>undef, action=>"opml", project_filter => $project_filter), -class => $feed_class}, "OPML") . " "; @@ -5784,6 +5792,9 @@ sub git_project_list_rows { "\n" . "\n"; } + + print ' '; + print "".($to + 1)." project".($to+1 >= 1 ? ($to+1 <= 1 ? "" : "s") : "")." found "; } sub git_project_list_body { @@ -5918,13 +5929,39 @@ 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"; + print "
\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 "\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'}; @@ -5935,8 +5972,9 @@ sub git_shortlog_body { print "\n"; } $alternate ^= 1; + print ""; # git_summary() used print "\n" . - print "\n" . + print "\n" . format_author_html('td', \%co, 10) . "\n"; } $alternate ^= 1; - print "\n" . + print "\n" . # shortlog: format_author_html('td', \%co, 10) format_author_html('td', \%co, 15, 3) . "\n" . + print "\n" . "\n" . "\n"; } $alternate ^= 1; - print "\n" . + print "\n" . format_author_html('td', \%co, 15, 5) . "
AuthorCommit
$co{'age_string'}$co{'age_string_date'}$co{'age_string_date'}"; print format_subject_html($co{'title'}, $co{'title_short'}, href(action=>"commit", hash=>$commit), $ref); @@ -5985,7 +6023,7 @@ sub git_history_body { print "
$co{'age_string_date'}$co{'age_string_date'}"; # originally git_history used chop_str($co{'title'}, 50) @@ -6315,7 +6353,7 @@ sub git_search_changes { $alternate ^= 1; %co = parse_commit($set{'commit'}); my $author = chop_and_escape_str($co{'author_name'}, 15, 5); - print "$co{'age_string_date'}$co{'age_string_date'}$author" . $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), @@ -6449,7 +6487,7 @@ sub git_search_grep_body { print "
$co{'age_string_date'}$co{'age_string_date'}" . $cgi->a({-href => href(action=>"commit", hash=>$co{'id'}), @@ -6644,12 +6682,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) { @@ -7422,11 +7460,12 @@ sub git_snapshot { } 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; @@ -7434,6 +7473,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"; } @@ -7490,7 +7532,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(); } -- 2.20.1