Skip to content

Commit 0ebe782

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

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

Documentation/gitweb.conf.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ $omit_age_column::
503503
If true, omit the column with date of the most current commit on the
504504
projects list page. It can save a bit of I/O and a fork per repository.
505505

506+
$omit_owner::
507+
If true prevents displaying information about repository owner.
508+
506509
$per_request_config::
507510
If this is set to code reference, it will be run once for each request.
508511
You can set parts of configuration that change per session this way.

gitweb/gitweb.perl

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ sub evaluate_uri {
136136
# don't generate age column on the projects list page
137137
our $omit_age_column = 0;
138138

139+
# don't generate information about owners of repositories
140+
our $omit_owner=0;
141+
139142
# show repository only if this subroutine returns true
140143
# when given the path to the project, for example:
141144
# sub { return -e "$_[0]/git-daemon-export-ok"; }
@@ -5465,8 +5468,10 @@ sub git_project_list_rows {
54655468
? esc_html_match_hl_chopped($pr->{'descr_long'},
54665469
$pr->{'descr'}, $search_regexp)
54675470
: esc_html($pr->{'descr'})) .
5468-
"</td>\n" .
5469-
"<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) . "</i></td>\n";
5471+
"</td>\n";
5472+
unless ($omit_owner) {
5473+
print "<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) . "</i></td>\n";
5474+
}
54705475
unless ($omit_age_column) {
54715476
print "<td class=\"". age_class($pr->{'age'}) . "\">" .
54725477
(defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n";
@@ -5502,7 +5507,9 @@ sub git_project_list_body {
55025507
'tagfilter' => $tagfilter)
55035508
if ($tagfilter || $search_regexp);
55045509
# fill the rest
5505-
my @all_fields = $omit_age_column ? ('descr', 'descr_long', 'owner', 'ctags', 'category') : ();
5510+
my @all_fields = ('descr', 'descr_long', 'ctags', 'category');
5511+
push @all_fields, ('age', 'age_string') unless($omit_age_column);
5512+
push @all_fields, 'owner' unless($omit_owner);
55065513
@projects = fill_project_list_info(\@projects, @all_fields);
55075514

55085515
$order ||= $default_projects_order;
@@ -5534,7 +5541,7 @@ sub git_project_list_body {
55345541
}
55355542
print_sort_th('project', $order, 'Project');
55365543
print_sort_th('descr', $order, 'Description');
5537-
print_sort_th('owner', $order, 'Owner');
5544+
print_sort_th('owner', $order, 'Owner') unless $omit_owner;
55385545
print_sort_th('age', $order, 'Last Change') unless $omit_age_column;
55395546
print "<th></th>\n" . # for links
55405547
"</tr>\n";
@@ -6288,8 +6295,10 @@ sub git_summary {
62886295

62896296
print "<div class=\"title\">&nbsp;</div>\n";
62906297
print "<table class=\"projects_list\">\n" .
6291-
"<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
6292-
"<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
6298+
"<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n";
6299+
unless ($omit_owner) {
6300+
print "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
6301+
}
62936302
if (defined $cd{'rfc2822'}) {
62946303
print "<tr id=\"metadata_lchange\"><td>last change</td>" .
62956304
"<td>".format_timestamp_html(\%cd)."</td></tr>\n";

0 commit comments

Comments
 (0)