Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 5710be4

Browse files
draenoggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 75e0dff commit 5710be4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Documentation/gitweb.conf.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ $maxload::
499499
Set `$maxload` to undefined value (`undef`) to turn this feature off.
500500
The default value is 300.
501501

502+
$omit_age_column::
503+
If true, omit the column with date of the most current commit on the
504+
projects list page. It can save a bit of I/O and a fork per repository.
505+
502506
$per_request_config::
503507
If this is set to code reference, it will be run once for each request.
504508
You can set parts of configuration that change per session this way.

gitweb/gitweb.perl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ sub evaluate_uri {
133133
# (only effective if this variable evaluates to true)
134134
our $export_ok = "++GITWEB_EXPORT_OK++";
135135

136+
# don't generate age column on the projects list page
137+
our $omit_age_column = 0;
138+
136139
# show repository only if this subroutine returns true
137140
# when given the path to the project, for example:
138141
# sub { return -e "$_[0]/git-daemon-export-ok"; }
@@ -5464,9 +5467,11 @@ sub git_project_list_rows {
54645467
: esc_html($pr->{'descr'})) .
54655468
"</td>\n" .
54665469
"<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) . "</i></td>\n";
5467-
print "<td class=\"". age_class($pr->{'age'}) . "\">" .
5468-
(defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n" .
5469-
"<td class=\"link\">" .
5470+
unless ($omit_age_column) {
5471+
print "<td class=\"". age_class($pr->{'age'}) . "\">" .
5472+
(defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n";
5473+
}
5474+
print"<td class=\"link\">" .
54705475
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary")}, "summary") . " | " .
54715476
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"shortlog")}, "shortlog") . " | " .
54725477
$cgi->a({-href => href(project=>$pr->{'path'}, action=>"log")}, "log") . " | " .
@@ -5497,7 +5502,8 @@ sub git_project_list_body {
54975502
'tagfilter' => $tagfilter)
54985503
if ($tagfilter || $search_regexp);
54995504
# fill the rest
5500-
@projects = fill_project_list_info(\@projects);
5505+
my @all_fields = $omit_age_column ? ('descr', 'descr_long', 'owner', 'ctags', 'category') : ();
5506+
@projects = fill_project_list_info(\@projects, @all_fields);
55015507

55025508
$order ||= $default_projects_order;
55035509
$from = 0 unless defined $from;
@@ -5529,7 +5535,7 @@ sub git_project_list_body {
55295535
print_sort_th('project', $order, 'Project');
55305536
print_sort_th('descr', $order, 'Description');
55315537
print_sort_th('owner', $order, 'Owner');
5532-
print_sort_th('age', $order, 'Last Change');
5538+
print_sort_th('age', $order, 'Last Change') unless $omit_age_column;
55335539
print "<th></th>\n" . # for links
55345540
"</tr>\n";
55355541
}

0 commit comments

Comments
 (0)