From 214513845a1251f88156f16363726bb74cebb5e4 Mon Sep 17 00:00:00 2001 From: Stricted Date: Mon, 21 Oct 2013 08:40:55 +0200 Subject: [PATCH] add newest gitweb files --- gitweb.css | 6 +++--- index.cgi | 45 ++++++++++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 18 deletions(-) mode change 100755 => 100644 index.cgi diff --git a/gitweb.css b/gitweb.css index 8b0811d..7144fb2 100644 --- a/gitweb.css +++ b/gitweb.css @@ -68,12 +68,13 @@ div.page_path { } div.page_footer { - height: 17px; + height: 22px; padding: 4px 8px; background-color: #d9d8d1; } div.page_footer_text { + line-height: 22px; float: left; color: #555555; font-style: italic; @@ -543,8 +544,7 @@ a.linenr { a.rss_logo { float: right; - padding: 3px 0px; - width: 35px; + padding: 3px 5px; line-height: 10px; border: 1px solid; border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e; diff --git a/index.cgi b/index.cgi old mode 100755 new mode 100644 index 79770e2..f365d89 --- a/index.cgi +++ b/index.cgi @@ -27,7 +27,7 @@ BEGIN { CGI->compile() if $ENV{'MOD_PERL'}; } -our $version = "1.8.1.2-Stricted"; +our $version = "1.8.4.1-Stricted"; our ($my_url, $my_uri, $base_url, $path_info, $home_link); sub evaluate_uri { @@ -85,6 +85,9 @@ our $project_maxdepth = 2007; # string of the home link on top of all pages our $home_link_str = "projects"; +# extra breadcrumbs preceding the home link +our @extra_breadcrumbs = (); + # name of your site or organization to appear in page titles # replace this with something more descriptive for clearer bookmarks our $site_name = "" @@ -115,9 +118,11 @@ our $javascript = "static/gitweb.js"; #our $logo_label = "git documentation"; 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 = ""; @@ -685,7 +690,7 @@ sub evaluate_gitweb_config { our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "/etc/gitweb.conf"; our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "/etc/gitweb-common.conf"; - # Protect agains duplications of file names, to not read config twice. + # Protect against duplications of file names, to not read config twice. # Only one of $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM is used, so # there possibility of duplication of filename there doesn't matter. $GITWEB_CONFIG = "" if ($GITWEB_CONFIG eq $GITWEB_CONFIG_COMMON); @@ -1088,7 +1093,7 @@ sub evaluate_and_validate_params { our $search_use_regexp = $input_params{'search_use_regexp'}; our $searchtext = $input_params{'searchtext'}; - our $search_regexp; + our $search_regexp = undef; if (defined $searchtext) { if (length($searchtext) < 2) { die_error(403, "At least two characters are required for search parameter"); @@ -1138,7 +1143,7 @@ sub handle_errors_html { # to avoid infinite loop where error occurs in die_error, # change handler to default handler, disabling handle_errors_html - set_message("Error occured when inside die_error:\n$msg"); + set_message("Error occurred when inside die_error:\n$msg"); # you cannot jump out of die_error when called as error handler; # the subroutine set via CGI::Carp::set_message is called _after_ @@ -2070,7 +2075,7 @@ sub picon_url { if (!$avatar_cache{$email}) { my ($user, $domain) = split('@', $email); $avatar_cache{$email} = - "http://www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" . + "//www.cs.indiana.edu/cgi-pub/kinzler/piconsearch.cgi/" . "$domain/$user/" . "users+domains+unknown/up/single"; } @@ -2085,7 +2090,7 @@ sub gravatar_url { my $email = lc shift; my $size = shift; $avatar_cache{$email} ||= - "http://www.gravatar.com/avatar/" . + "//www.gravatar.com/avatar/" . Digest::MD5::md5_hex($email) . "?s="; return $avatar_cache{$email} . $size; } @@ -3984,7 +3989,9 @@ sub print_nav_breadcrumbs_path { sub print_nav_breadcrumbs { my %opts = @_; - print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / "; + for my $crumb (@extra_breadcrumbs, [ $home_link_str => $home_link ]) { + print $cgi->a({-href => esc_url($crumb->[1])}, $crumb->[0]) . " / "; + } if (defined $project) { my @dirname = split '/', $project; my $projectbasename = pop @dirname; @@ -4032,8 +4039,8 @@ sub print_search_form { $cgi->input({-name=>"h", -value=>$search_hash, -type=>"hidden"}) . "\n" . $cgi->popup_menu(-name => 'st', -default => 'commit', -values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) . - $cgi->sup($cgi->a({-href => href(action=>"search_help")}, "?")) . - " search:\n", + " " . $cgi->a({-href => href(action=>"search_help"), + -title => "search help" }, "?") . " search:\n", $cgi->textfield(-name => "s", -value => $searchtext, -override => 1) . "\n" . "" . $cgi->checkbox(-name => 'sr', -value => 1, -label => 're', @@ -4728,11 +4735,11 @@ sub git_difftree_body { my ($difftree, $hash, @parents) = @_; my ($parent) = $parents[0]; my $have_blame = gitweb_check_feature('blame'); - print "
\n"; if ($#{$difftree} > 10) { + print "
\n"; print(($#{$difftree} + 1) . " files changed:\n"); + print "
\n"; } - print "
\n"; print " 1 ? "combined " : "") . @@ -5798,11 +5805,14 @@ sub git_shortlog_body { $from = 0 unless defined $from; $to = $#{$commitlist} if (!defined $to || $#{$commitlist} < $to); + 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"; } @@ -5815,13 +5825,14 @@ sub git_shortlog_body { 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'}; @@ -6493,7 +6504,7 @@ sub git_summary { print "
 
\n"; print "
AuthorCommit
\n" . "\n"; - unless ($omit_owner) { + if ($owner and not $omit_owner) { print "\n"; } if (defined $cd{'rfc2822'}) { @@ -6544,7 +6555,7 @@ sub git_summary { git_print_header_div('shortlog'); git_shortlog_body(\@commitlist, 0, 15, $refs, $#commitlist <= 15 ? undef : - $cgi->a({-href => href(action=>"shortlog")}, "..."), 0, 0, 0, 1);; + $cgi->a({-href => href(action=>"shortlog")}, "..."), 0, 0, 0, 1); } if (@taglist) { @@ -6656,6 +6667,7 @@ sub git_blame_common { $hash_base, '--', $file_name or die_error(500, "Open git-blame --porcelain failed"); } + binmode $fd, ':utf8'; # incremental blame data returns early if ($format eq 'data') { @@ -7306,6 +7318,9 @@ sub git_log_generic { $base = $head; $allrefs = 1; } + if (!defined $base) { + $base = $head; + } if (!defined $page) { $page = 0; } @@ -7520,7 +7535,7 @@ sub git_object { system(git_cmd(), "cat-file", '-e', $hash_base) == 0 or die_error(404, "Base object does not exist"); - # here errors should not hapen + # here errors should not happen open my $fd, "-|", git_cmd(), "ls-tree", $hash_base, "--", $file_name or die_error(500, "Open git-ls-tree failed"); my $line = <$fd>; -- 2.20.1
description" . esc_html($descr) . "
owner" . esc_html($owner) . "