git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: The "Owner" column can be hidden

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 31, 2010, 10:28 UTC
Message-ID
<m3eij0iy5m.fsf@localhost.localdomain>
In-Reply-To
<1270026409-29543-1-git-send-email-jstepien@users.sourceforge.net>
Jan Stępień  <jstepien@users.sourceforge.net> writes:
> This commit adds $show_owner_column configuration variable which allows
> to hide the project list "Owner" column if desired.
>

This commit message is a bit lacking, in that it does not describe *why* one would want to hide "Owner" column in projects list page. It is not described either why "Owner" column is unique among all other columns, in that it is the only column that can be hidden.

Besides for completeness you might want to hide "Owner" row in project
summary page.
 
> Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
> ---
>  gitweb/gitweb.perl |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)

While "Gitweb config file variables" section in gitweb/README does not need to include _all_ gitweb configuration variables, you should thing about it whether to include description of '$show_owner_column' (or just '$show_owner') in gitweb/README, and whether to include note about this variable in "Projects list file format" in this file.

Show 10 quoted lines
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index a2d2283..95f7f06 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -160,6 +160,9 @@ our @diff_opts = ('-M'); # taken from git_commit
>  # the gitweb domain.
>  our $prevent_xss = 0;
>  
> +# presense of the projects list "Owner" column
I'd rather have here

+# If false, hide "Owner" column on projects list page, and "Owner" row +# in the project summary page.

> +our $show_owner_column = 1;
Perhaps it should be '$show_owner', or '$hide_owner'.

BTW. if it would hide owner everywhere, you might want to skip generating / reading projects owners.

Show 27 quoted lines
> +
>  # information about snapshot formats that gitweb is capable of serving
>  our %known_snapshot_formats = (
>  	# name => {
> @@ -4430,7 +4433,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') if $show_owner_column;
>  		print_sort_th('age', $order, 'Last Change');
>  		print "<th></th>\n" . # for links
>  		      "</tr>\n";
> @@ -4469,8 +4472,8 @@ sub git_project_list_body {
>  		                        -class => "list"}, esc_html($pr->{'path'})) . "</td>\n" .
>  		      "<td>" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>"summary"),
>  		                        -class => "list", -title => $pr->{'descr_long'}},
> -		                        esc_html($pr->{'descr'})) . "</td>\n" .
> -		      "<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) . "</i></td>\n";
> +		                        esc_html($pr->{'descr'})) . "</td>\n";
> +		print "<td><i>" . chop_and_escape_str($pr->{'owner'}, 15) .  "</i></td>\n" if $show_owner_column;
>  		print "<td class=\"". age_class($pr->{'age'}) . "\">" .
>  		      (defined $pr->{'age_string'} ? $pr->{'age_string'} : "No commits") . "</td>\n" .
>  		      "<td class=\"link\">" .
> -- 
> 1.7.0.3
> 
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jan StępieńNext: Jan Stępień
Message 4 of 6 in “gitweb: The "Owner" column can be hidden”
  1. gitweb: The "Owner" column can be hiddenJan Stępień, Mar 31, 2010
  2. Junio C HamanoMar 31, 2010
  3. Jan StępieńMar 31, 2010
  4. Jakub NarebskiMar 31, 2010
  5. Jan StępieńMar 31, 2010
  6. Jakub NarebskiMar 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.