* [PATCH] gitweb: The "Owner" column can be hidden
@ 2010-03-31 9:06 Jan Stępień
2010-03-31 9:48 ` Junio C Hamano
2010-03-31 10:28 ` Jakub Narebski
0 siblings, 2 replies; 6+ messages in thread
From: Jan Stępień @ 2010-03-31 9:06 UTC (permalink / raw)
To: git; +Cc: Jan Stępień
This commit adds $show_owner_column configuration variable which allows
to hide the project list "Owner" column if desired.
Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
---
gitweb/gitweb.perl | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
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
+our $show_owner_column = 1;
+
# 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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: The "Owner" column can be hidden
2010-03-31 9:06 [PATCH] gitweb: The "Owner" column can be hidden Jan Stępień
@ 2010-03-31 9:48 ` Junio C Hamano
2010-03-31 13:32 ` Jan Stępień
2010-03-31 10:28 ` Jakub Narebski
1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2010-03-31 9:48 UTC (permalink / raw)
To: Jan Stępień; +Cc: git
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.
>
> @@ -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');
Ugly. Think what you would do if somebody else asks you to allow him to
omit 'Description', or perhaps 'Last Change'.
I would understand if the change was to introduce a configuration variable
of the array type @project_column whose default value is qw(project descr
owner age) that is used to control which columns are shown in what order.
If it is undesirable to allow reordering the columns, the configuration
should at least be %omit_project_column used like this, no?
print_sort_th('project', $order, 'Project')
unless $omit_project_column{'project'};
print_sort_th('descr', $order, 'Description')
unless $omit_project_column{'descr'};
...
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: The "Owner" column can be hidden
2010-03-31 9:06 [PATCH] gitweb: The "Owner" column can be hidden Jan Stępień
2010-03-31 9:48 ` Junio C Hamano
@ 2010-03-31 10:28 ` Jakub Narebski
2010-03-31 13:16 ` Jan Stępień
1 sibling, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2010-03-31 10:28 UTC (permalink / raw)
To: Jan Stępień; +Cc: git
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.
>
> 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.
> +
> # 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: The "Owner" column can be hidden
2010-03-31 10:28 ` Jakub Narebski
@ 2010-03-31 13:16 ` Jan Stępień
2010-03-31 17:43 ` Jakub Narebski
0 siblings, 1 reply; 6+ messages in thread
From: Jan Stępień @ 2010-03-31 13:16 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
On Wed, 31 Mar 2010 03:28:24 -0700 (PDT)
Jakub Narebski <jnareb@gmail.com> wrote:
> 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.
>
The reason why I think gitweb should allow hiding the "Owner" row are
situations when its used for displaying a single person's repositories.
In such situation repeating the owner's name in each row may be
unnecessary in one's point of view and an option for hiding the whole
column could be a solution.
> > 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.
>
I agree with you on adding it to the "Gitweb config file variables"
section. On the other hand, I think that mentioning it in "Projects
list file format" isn't necessary unless '$show_owner' would affect the
way the projects list file would be parsed.
> >
> > 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.
>
Yes, that sounds better.
> > +our $show_owner_column = 1;
>
> Perhaps it should be '$show_owner', or '$hide_owner'.
>
Agreed. Given that displaying owner information is the default behaviour
I guess that "$hide_owner" or "$omit_owner" will be a better name for
it.
> BTW. if it would hide owner everywhere, you might want to skip
> generating / reading projects owners.
>
Broadening the scope of this variable and hiding owner information also
on the project info page is more than I initially thought of, but it
seems like a good idea. In this case I'll add skipping owner generation
to the next version of the patch.
Thanks for comments!
Cheers,
--
Jan Stępień <jan@stepien.cc>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: The "Owner" column can be hidden
2010-03-31 9:48 ` Junio C Hamano
@ 2010-03-31 13:32 ` Jan Stępień
0 siblings, 0 replies; 6+ messages in thread
From: Jan Stępień @ 2010-03-31 13:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Wed, 31 Mar 2010 02:48:57 -0700
Junio C Hamano <gitster@pobox.com> wrote:
> 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.
> >
> > @@ -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');
>
> Ugly. Think what you would do if somebody else asks you to allow him to
> omit 'Description', or perhaps 'Last Change'.
>
> I would understand if the change was to introduce a configuration variable
> of the array type @project_column whose default value is qw(project descr
> owner age) that is used to control which columns are shown in what order.
>
> If it is undesirable to allow reordering the columns, the configuration
> should at least be %omit_project_column used like this, no?
>
> print_sort_th('project', $order, 'Project')
> unless $omit_project_column{'project'};
> print_sort_th('descr', $order, 'Description')
> unless $omit_project_column{'descr'};
> ...
>
As I wrote in my e-mail to Jakub Narebski, the reason for hiding only
the "Owner" column is a single-user situation. There's only one owner
and repeating his name in each column isn't necessary.
I agree that your solution is cleaner and allows further customization,
but it covers a slightly different issue comparing to the one I'm
addressing.
I like the idea suggested by Jakub to make this config variable cover
other pages. It could remove the owner information from both the
project list and project summaries.
Cheers,
--
Jan Stępień <jan@stepien.cc>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: The "Owner" column can be hidden
2010-03-31 13:16 ` Jan Stępień
@ 2010-03-31 17:43 ` Jakub Narebski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2010-03-31 17:43 UTC (permalink / raw)
To: Jan Stępień; +Cc: git
On Wed, 31 Mar 2010, Jan Stępień wrote:
> On Wed, 31 Mar 2010 03:28:24 -0700 (PDT)
> Jakub Narebski <jnareb@gmail.com> wrote:
> > 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.
>
> The reason why I think gitweb should allow hiding the "Owner" row are
> situations when its used for displaying a single person's repositories.
> In such situation repeating the owner's name in each row may be
> unnecessary in one's point of view and an option for hiding the whole
> column could be a solution.
Such description should be put in the commit message.
By the way it follows from the above descriptions that one might want
to hide (not show) "Owner" column in projects list page, because it is
repetitous and doesn't give much information, but retain "Owner" field
(row) in the projects 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.
>
> I agree with you on adding it to the "Gitweb config file variables"
> section. On the other hand, I think that mentioning it in "Projects
> list file format" isn't necessary unless '$show_owner' would affect the
> way the projects list file would be parsed.
By the way, you might want to add description on *whe* one might want
to use $hide_owner / $omit_owner / $show_owner in gitweb/README, and
not only in commit message.
[...]
> > BTW. if it would hide owner everywhere, you might want to skip
> > generating / reading projects owners.
> >
>
> Broadening the scope of this variable and hiding owner information also
> on the project info page is more than I initially thought of, but it
> seems like a good idea. In this case I'll add skipping owner generation
> to the next version of the patch.
Well, you can always leave it for later commit... but I think that
generating data one would not use is a bit wasteful.
--
Jakub Narębski
Poland
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-31 17:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 9:06 [PATCH] gitweb: The "Owner" column can be hidden Jan Stępień
2010-03-31 9:48 ` Junio C Hamano
2010-03-31 13:32 ` Jan Stępień
2010-03-31 10:28 ` Jakub Narebski
2010-03-31 13:16 ` Jan Stępień
2010-03-31 17:43 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).