From 5710be46d88ea548159e7493973b5488e6d2799f Mon Sep 17 00:00:00 2001 From: Kacper Kornet Date: Tue, 24 Apr 2012 19:39:15 +0200 Subject: gitweb: Option to omit column with time of the last change Generating information about last change for a large number of git repositories can be very time consuming. This commit add an option to omit 'Last Change' column when presenting the list of repositories. Signed-off-by: Kacper Kornet Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'gitweb') diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index f9ec0de668..00857347d9 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -133,6 +133,9 @@ our $default_projects_order = "project"; # (only effective if this variable evaluates to true) our $export_ok = "++GITWEB_EXPORT_OK++"; +# don't generate age column on the projects list page +our $omit_age_column = 0; + # show repository only if this subroutine returns true # when given the path to the project, for example: # sub { return -e "$_[0]/git-daemon-export-ok"; } @@ -5464,9 +5467,11 @@ sub git_project_list_rows { : esc_html($pr->{'descr'})) . "\n" . "" . chop_and_escape_str($pr->{'owner'}, 15) . "\n"; - print "{'age'}) . "\">" . - (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "\n" . - "" . + unless ($omit_age_column) { + print "{'age'}) . "\">" . + (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "\n"; + } + print"" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " . @@ -5497,7 +5502,8 @@ sub git_project_list_body { 'tagfilter' => $tagfilter) if ($tagfilter || $search_regexp); # fill the rest - @projects = fill_project_list_info(\@projects); + my @all_fields = $omit_age_column ? ('descr', 'descr_long', 'owner', 'ctags', 'category') : (); + @projects = fill_project_list_info(\@projects, @all_fields); $order ||= $default_projects_order; $from = 0 unless defined $from; @@ -5529,7 +5535,7 @@ sub git_project_list_body { print_sort_th('project', $order, 'Project'); print_sort_th('descr', $order, 'Description'); print_sort_th('owner', $order, 'Owner'); - print_sort_th('age', $order, 'Last Change'); + print_sort_th('age', $order, 'Last Change') unless $omit_age_column; print "\n" . # for links "\n"; } -- cgit v1.2.1 From 0ebe7827b6f00797ab850e8ebc28f0fa22f1df55 Mon Sep 17 00:00:00 2001 From: Kacper Kornet Date: Thu, 26 Apr 2012 18:45:44 +0200 Subject: gitweb: Option to not display information about owner In some setups the repository owner is not a well defined concept and administrator can prefer it to be not shown. This commit add and an option that enable to reach this effect. Signed-off-by: Kacper Kornet Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'gitweb') diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 00857347d9..cf160a1b57 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -136,6 +136,9 @@ our $export_ok = "++GITWEB_EXPORT_OK++"; # don't generate age column on the projects list page our $omit_age_column = 0; +# don't generate information about owners of repositories +our $omit_owner=0; + # show repository only if this subroutine returns true # when given the path to the project, for example: # sub { return -e "$_[0]/git-daemon-export-ok"; } @@ -5465,8 +5468,10 @@ sub git_project_list_rows { ? esc_html_match_hl_chopped($pr->{'descr_long'}, $pr->{'descr'}, $search_regexp) : esc_html($pr->{'descr'})) . - "\n" . - "" . chop_and_escape_str($pr->{'owner'}, 15) . "\n"; + "\n"; + unless ($omit_owner) { + print "" . chop_and_escape_str($pr->{'owner'}, 15) . "\n"; + } unless ($omit_age_column) { print "{'age'}) . "\">" . (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "\n"; @@ -5502,7 +5507,9 @@ sub git_project_list_body { 'tagfilter' => $tagfilter) if ($tagfilter || $search_regexp); # fill the rest - my @all_fields = $omit_age_column ? ('descr', 'descr_long', 'owner', 'ctags', 'category') : (); + my @all_fields = ('descr', 'descr_long', 'ctags', 'category'); + push @all_fields, ('age', 'age_string') unless($omit_age_column); + push @all_fields, 'owner' unless($omit_owner); @projects = fill_project_list_info(\@projects, @all_fields); $order ||= $default_projects_order; @@ -5534,7 +5541,7 @@ sub git_project_list_body { } print_sort_th('project', $order, 'Project'); print_sort_th('descr', $order, 'Description'); - print_sort_th('owner', $order, 'Owner'); + print_sort_th('owner', $order, 'Owner') unless $omit_owner; print_sort_th('age', $order, 'Last Change') unless $omit_age_column; print "\n" . # for links "\n"; @@ -6288,8 +6295,10 @@ sub git_summary { print "
 
\n"; print "\n" . - "\n" . - "\n"; + "\n"; + unless ($omit_owner) { + print "\n"; + } if (defined $cd{'rfc2822'}) { print "" . "\n"; -- cgit v1.2.1
description" . esc_html($descr) . "
owner" . esc_html($owner) . "
description" . esc_html($descr) . "
owner" . esc_html($owner) . "
last change".format_timestamp_html(\%cd)."