apply gitweb changes master
authorJan Altensen <info@stricted.net>
Wed, 3 Jul 2019 15:02:03 +0000 (17:02 +0200)
committerJan Altensen <info@stricted.net>
Wed, 3 Jul 2019 15:02:03 +0000 (17:02 +0200)
Change-Id: I8287706610aa37bcb73f78cdf8875027e4c10bb6

index.cgi

index b76e0fc70df3a91831cc2ce34a36a59317b074c9..6dd340e19e1fb722989ea12bbe12849c9299e549 100644 (file)
--- 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 "<div class=\"page_footer_text\">Copyright &copy; $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") . " ";
@@ -5784,6 +5792,9 @@ sub git_project_list_rows {
                      "</td>\n" .
                      "</tr>\n";
        }
+
+       print '<tr><td colspan="'.($check_forks ? '1' : '2').'">&nbsp;</td>';
+       print "<td>".($to + 1)." project".($to+1 >= 1 ? ($to+1 <= 1 ? "" : "s") : "")." found</td><td colspan=\"3\">&nbsp;</td></tr>";
 }
 
 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 "<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'};
@@ -5935,8 +5972,9 @@ sub git_shortlog_body {
                        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);
@@ -5985,7 +6023,7 @@ sub git_history_body {
                        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)
@@ -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 "<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'}),
@@ -6449,7 +6487,7 @@ sub git_search_grep_body {
                        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'}),
@@ -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();
 }