{"thread":{"id":"23267","subject":"[PATCH] gitweb: The \"Owner\" column can be hidden","startedAt":"2010-03-31T09:06:49Z","lastAt":"2010-03-31T17:43:11Z","messageCount":6,"participants":["Jan Stępień","Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"138267","messageId":"1270026409-29543-1-git-send-email-jstepien@users.sourceforge.net","threadId":"23267","inReplyTo":null,"subject":"[PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Jan Stępień","fromEmail":"jstepien@users.sourceforge.net","sentAt":"2010-03-31T09:06:49Z","receivedAt":"2010-03-31T09:06:49Z","isPatch":true,"sender":{"key":"jstepien@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/39084?v=4"},"body":"This commit adds $show_owner_column configuration variable which allows\nto hide the project list \"Owner\" column if desired.\n\nSigned-off-by: Jan Stępień <jstepien@users.sourceforge.net>\n---\n gitweb/gitweb.perl |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex a2d2283..95f7f06 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -160,6 +160,9 @@ our @diff_opts = ('-M'); # taken from git_commit\n # the gitweb domain.\n our $prevent_xss = 0;\n \n+# presense of the projects list \"Owner\" column\n+our $show_owner_column = 1;\n+\n # information about snapshot formats that gitweb is capable of serving\n our %known_snapshot_formats = (\n \t# name => {\n@@ -4430,7 +4433,7 @@ sub git_project_list_body {\n \t\t}\n \t\tprint_sort_th('project', $order, 'Project');\n \t\tprint_sort_th('descr', $order, 'Description');\n-\t\tprint_sort_th('owner', $order, 'Owner');\n+\t\tprint_sort_th('owner', $order, 'Owner') if $show_owner_column;\n \t\tprint_sort_th('age', $order, 'Last Change');\n \t\tprint \"<th></th>\\n\" . # for links\n \t\t      \"</tr>\\n\";\n@@ -4469,8 +4472,8 @@ sub git_project_list_body {\n \t\t                        -class => \"list\"}, esc_html($pr->{'path'})) . \"</td>\\n\" .\n \t\t      \"<td>\" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"summary\"),\n \t\t                        -class => \"list\", -title => $pr->{'descr_long'}},\n-\t\t                        esc_html($pr->{'descr'})) . \"</td>\\n\" .\n-\t\t      \"<td><i>\" . chop_and_escape_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n+\t\t                        esc_html($pr->{'descr'})) . \"</td>\\n\";\n+\t\tprint \"<td><i>\" . chop_and_escape_str($pr->{'owner'}, 15) .  \"</i></td>\\n\" if $show_owner_column;\n \t\tprint \"<td class=\\\"\". age_class($pr->{'age'}) . \"\\\">\" .\n \t\t      (defined $pr->{'age_string'} ? $pr->{'age_string'} : \"No commits\") . \"</td>\\n\" .\n \t\t      \"<td class=\\\"link\\\">\" .\n-- \n1.7.0.3\n"},{"id":"138270","messageId":"7vy6h8om7q.fsf@alter.siamese.dyndns.org","threadId":"23267","inReplyTo":"1270026409-29543-1-git-send-email-jstepien@users.sourceforge.net","subject":"Re: [PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-31T09:48:57Z","receivedAt":"2010-03-31T09:48:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jan Stępień  <jstepien@users.sourceforge.net> writes:\n\n> This commit adds $show_owner_column configuration variable which allows\n> to hide the project list \"Owner\" column if desired.\n> \n> @@ -4430,7 +4433,7 @@ sub git_project_list_body {\n>  \t\t}\n>  \t\tprint_sort_th('project', $order, 'Project');\n>  \t\tprint_sort_th('descr', $order, 'Description');\n> -\t\tprint_sort_th('owner', $order, 'Owner');\n> +\t\tprint_sort_th('owner', $order, 'Owner') if $show_owner_column;\n>  \t\tprint_sort_th('age', $order, 'Last Change');\n\nUgly.  Think what you would do if somebody else asks you to allow him to\nomit 'Description', or perhaps 'Last Change'.\n\nI would understand if the change was to introduce a configuration variable\nof the array type @project_column whose default value is qw(project descr\nowner age) that is used to control which columns are shown in what order.\n\nIf it is undesirable to allow reordering the columns, the configuration\nshould at least be %omit_project_column used like this, no?\n\n\tprint_sort_th('project', $order, 'Project')\n        \tunless $omit_project_column{'project'};\n\tprint_sort_th('descr', $order, 'Description')\n        \tunless $omit_project_column{'descr'};\n\t...\n"},{"id":"138271","messageId":"m3eij0iy5m.fsf@localhost.localdomain","threadId":"23267","inReplyTo":"1270026409-29543-1-git-send-email-jstepien@users.sourceforge.net","subject":"Re: [PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-31T10:28:24Z","receivedAt":"2010-03-31T10:28:24Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jan Stępień  <jstepien@users.sourceforge.net> writes:\n\n> This commit adds $show_owner_column configuration variable which allows\n> to hide the project list \"Owner\" column if desired.\n>\n\nThis commit message is a bit lacking, in that it does not describe\n*why* one would want to hide \"Owner\" column in projects list page.\nIt is not described either why \"Owner\" column is unique among all\nother columns, in that it is the only column that can be hidden.\n\nBesides for completeness you might want to hide \"Owner\" row in project\nsummary page.\n \n> Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>\n> ---\n>  gitweb/gitweb.perl |    9 ++++++---\n>  1 files changed, 6 insertions(+), 3 deletions(-)\n\nWhile \"Gitweb config file variables\" section in gitweb/README does not\nneed to include _all_ gitweb configuration variables, you should thing\nabout it whether to include description of '$show_owner_column' (or\njust '$show_owner') in gitweb/README, and whether to include note\nabout this variable in \"Projects list file format\" in this file.\n\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index a2d2283..95f7f06 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -160,6 +160,9 @@ our @diff_opts = ('-M'); # taken from git_commit\n>  # the gitweb domain.\n>  our $prevent_xss = 0;\n>  \n> +# presense of the projects list \"Owner\" column\n\nI'd rather have here\n\n+# If false, hide \"Owner\" column on projects list page, and \"Owner\" row\n+# in the project summary page.\n\n> +our $show_owner_column = 1;\n\nPerhaps it should be '$show_owner', or '$hide_owner'.\n\nBTW. if it would hide owner everywhere, you might want to skip\ngenerating / reading projects owners.\n\n> +\n>  # information about snapshot formats that gitweb is capable of serving\n>  our %known_snapshot_formats = (\n>  \t# name => {\n> @@ -4430,7 +4433,7 @@ sub git_project_list_body {\n>  \t\t}\n>  \t\tprint_sort_th('project', $order, 'Project');\n>  \t\tprint_sort_th('descr', $order, 'Description');\n> -\t\tprint_sort_th('owner', $order, 'Owner');\n> +\t\tprint_sort_th('owner', $order, 'Owner') if $show_owner_column;\n>  \t\tprint_sort_th('age', $order, 'Last Change');\n>  \t\tprint \"<th></th>\\n\" . # for links\n>  \t\t      \"</tr>\\n\";\n> @@ -4469,8 +4472,8 @@ sub git_project_list_body {\n>  \t\t                        -class => \"list\"}, esc_html($pr->{'path'})) . \"</td>\\n\" .\n>  \t\t      \"<td>\" . $cgi->a({-href => href(project=>$pr->{'path'}, action=>\"summary\"),\n>  \t\t                        -class => \"list\", -title => $pr->{'descr_long'}},\n> -\t\t                        esc_html($pr->{'descr'})) . \"</td>\\n\" .\n> -\t\t      \"<td><i>\" . chop_and_escape_str($pr->{'owner'}, 15) . \"</i></td>\\n\";\n> +\t\t                        esc_html($pr->{'descr'})) . \"</td>\\n\";\n> +\t\tprint \"<td><i>\" . chop_and_escape_str($pr->{'owner'}, 15) .  \"</i></td>\\n\" if $show_owner_column;\n>  \t\tprint \"<td class=\\\"\". age_class($pr->{'age'}) . \"\\\">\" .\n>  \t\t      (defined $pr->{'age_string'} ? $pr->{'age_string'} : \"No commits\") . \"</td>\\n\" .\n>  \t\t      \"<td class=\\\"link\\\">\" .\n> -- \n> 1.7.0.3\n> \n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"138285","messageId":"20100331151648.dbd8bd45.jan@stepien.cc","threadId":"23267","inReplyTo":"m3eij0iy5m.fsf@localhost.localdomain","subject":"Re: [PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Jan Stępień","fromEmail":"jan@stepien.cc","sentAt":"2010-03-31T13:16:48Z","receivedAt":"2010-03-31T13:16:48Z","isPatch":true,"sender":{"key":"jan@stepien.cc","avatar":"https://gravatar.com/avatar/3b33886a822d755985d46e0fe448703bf3bd15e9822b1a7fed71f48b23d1a49c?d=mp&s=160"},"body":"On Wed, 31 Mar 2010 03:28:24 -0700 (PDT)\nJakub Narebski <jnareb@gmail.com> wrote:\n> Jan Stępień  <jstepien@users.sourceforge.net> writes:\n> \n> > This commit adds $show_owner_column configuration variable which allows\n> > to hide the project list \"Owner\" column if desired.\n> >\n> \n> This commit message is a bit lacking, in that it does not describe\n> *why* one would want to hide \"Owner\" column in projects list page.\n> It is not described either why \"Owner\" column is unique among all\n> other columns, in that it is the only column that can be hidden.\n> \n> Besides for completeness you might want to hide \"Owner\" row in project\n> summary page.\n> \n\nThe reason why I think gitweb should allow hiding the \"Owner\" row are\nsituations when its used for displaying a single person's repositories.\nIn such situation repeating the owner's name in each row may be\nunnecessary in one's point of view and an option for hiding the whole\ncolumn could be a solution.\n\n> > Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>\n> > ---\n> >  gitweb/gitweb.perl |    9 ++++++---\n> >  1 files changed, 6 insertions(+), 3 deletions(-)\n> \n> While \"Gitweb config file variables\" section in gitweb/README does not\n> need to include _all_ gitweb configuration variables, you should thing\n> about it whether to include description of '$show_owner_column' (or\n> just '$show_owner') in gitweb/README, and whether to include note\n> about this variable in \"Projects list file format\" in this file.\n> \n\nI agree with you on adding it to the \"Gitweb config file variables\"\nsection. On the other hand, I think that mentioning it in \"Projects\nlist file format\" isn't necessary unless '$show_owner' would affect the\nway the projects list file would be parsed.\n\n> > \n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index a2d2283..95f7f06 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -160,6 +160,9 @@ our @diff_opts = ('-M'); # taken from git_commit\n> >  # the gitweb domain.\n> >  our $prevent_xss = 0;\n> >  \n> > +# presense of the projects list \"Owner\" column\n> \n> I'd rather have here\n> \n> +# If false, hide \"Owner\" column on projects list page, and \"Owner\" row\n> +# in the project summary page.\n> \n\nYes, that sounds better.\n\n> > +our $show_owner_column = 1;\n> \n> Perhaps it should be '$show_owner', or '$hide_owner'.\n> \n\nAgreed. Given that displaying owner information is the default behaviour\nI guess that \"$hide_owner\" or \"$omit_owner\" will be a better name for\nit.\n\n> BTW. if it would hide owner everywhere, you might want to skip\n> generating / reading projects owners.\n> \n\nBroadening the scope of this variable and hiding owner information also\non the project info page is more than I initially thought of, but it\nseems like a good idea. In this case I'll add skipping owner generation\nto the next version of the patch.\n\nThanks for comments!\n\nCheers,\n-- \nJan Stępień <jan@stepien.cc>\n"},{"id":"138287","messageId":"20100331153218.6b13853b.jan@stepien.cc","threadId":"23267","inReplyTo":"7vy6h8om7q.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Jan Stępień","fromEmail":"jan@stepien.cc","sentAt":"2010-03-31T13:32:18Z","receivedAt":"2010-03-31T13:32:18Z","isPatch":true,"sender":{"key":"jan@stepien.cc","avatar":"https://gravatar.com/avatar/3b33886a822d755985d46e0fe448703bf3bd15e9822b1a7fed71f48b23d1a49c?d=mp&s=160"},"body":"On Wed, 31 Mar 2010 02:48:57 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n> Jan Stępień  <jstepien@users.sourceforge.net> writes:\n> \n> > This commit adds $show_owner_column configuration variable which allows\n> > to hide the project list \"Owner\" column if desired.\n> > \n> > @@ -4430,7 +4433,7 @@ sub git_project_list_body {\n> >  \t\t}\n> >  \t\tprint_sort_th('project', $order, 'Project');\n> >  \t\tprint_sort_th('descr', $order, 'Description');\n> > -\t\tprint_sort_th('owner', $order, 'Owner');\n> > +\t\tprint_sort_th('owner', $order, 'Owner') if $show_owner_column;\n> >  \t\tprint_sort_th('age', $order, 'Last Change');\n> \n> Ugly.  Think what you would do if somebody else asks you to allow him to\n> omit 'Description', or perhaps 'Last Change'.\n> \n> I would understand if the change was to introduce a configuration variable\n> of the array type @project_column whose default value is qw(project descr\n> owner age) that is used to control which columns are shown in what order.\n> \n> If it is undesirable to allow reordering the columns, the configuration\n> should at least be %omit_project_column used like this, no?\n> \n> \tprint_sort_th('project', $order, 'Project')\n>         \tunless $omit_project_column{'project'};\n> \tprint_sort_th('descr', $order, 'Description')\n>         \tunless $omit_project_column{'descr'};\n> \t...\n> \n\nAs I wrote in my e-mail to Jakub Narebski, the reason for hiding only\nthe \"Owner\" column is a single-user situation. There's only one owner\nand repeating his name in each column isn't necessary.\n\nI agree that your solution is cleaner and allows further customization,\nbut it covers a slightly different issue comparing to the one I'm\naddressing.\n\nI like the idea suggested by Jakub to make this config variable cover\nother pages. It could remove the owner information from both the\nproject list and project summaries.\n\nCheers,\n-- \nJan Stępień <jan@stepien.cc>\n"},{"id":"138298","messageId":"201003311943.13031.jnareb@gmail.com","threadId":"23267","inReplyTo":"20100331151648.dbd8bd45.jan@stepien.cc","subject":"Re: [PATCH] gitweb: The \"Owner\" column can be hidden","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-03-31T17:43:11Z","receivedAt":"2010-03-31T17:43:11Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 31 Mar 2010, Jan Stępień wrote:\n> On Wed, 31 Mar 2010 03:28:24 -0700 (PDT)\n> Jakub Narebski <jnareb@gmail.com> wrote:\n> > Jan Stępień  <jstepien@users.sourceforge.net> writes:\n> > \n> > > This commit adds $show_owner_column configuration variable which allows\n> > > to hide the project list \"Owner\" column if desired.\n> > >\n> > \n> > This commit message is a bit lacking, in that it does not describe\n> > *why* one would want to hide \"Owner\" column in projects list page.\n> > It is not described either why \"Owner\" column is unique among all\n> > other columns, in that it is the only column that can be hidden.\n> > \n> > Besides for completeness you might want to hide \"Owner\" row in project\n> > summary page.\n> \n> The reason why I think gitweb should allow hiding the \"Owner\" row are\n> situations when its used for displaying a single person's repositories.\n> In such situation repeating the owner's name in each row may be\n> unnecessary in one's point of view and an option for hiding the whole\n> column could be a solution.\n\nSuch description should be put in the commit message.\n\nBy the way it follows from the above descriptions that one might want\nto hide (not show) \"Owner\" column in projects list page, because it is\nrepetitous and doesn't give much information, but retain \"Owner\" field\n(row) in the projects summary page.\n \n> > > Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>\n> > > ---\n> > >  gitweb/gitweb.perl |    9 ++++++---\n> > >  1 files changed, 6 insertions(+), 3 deletions(-)\n> > \n> > While \"Gitweb config file variables\" section in gitweb/README does not\n> > need to include _all_ gitweb configuration variables, you should thing\n> > about it whether to include description of '$show_owner_column' (or\n> > just '$show_owner') in gitweb/README, and whether to include note\n> > about this variable in \"Projects list file format\" in this file.\n> \n> I agree with you on adding it to the \"Gitweb config file variables\"\n> section. On the other hand, I think that mentioning it in \"Projects\n> list file format\" isn't necessary unless '$show_owner' would affect the\n> way the projects list file would be parsed.\n\nBy the way, you might want to add description on *whe* one might want\nto use $hide_owner / $omit_owner / $show_owner in gitweb/README, and\nnot only in commit message.\n \n[...]\n> > BTW. if it would hide owner everywhere, you might want to skip\n> > generating / reading projects owners.\n> > \n> \n> Broadening the scope of this variable and hiding owner information also\n> on the project info page is more than I initially thought of, but it\n> seems like a good idea. In this case I'll add skipping owner generation\n> to the next version of the patch.\n\nWell, you can always leave it for later commit... but I think that\ngenerating data one would not use is a bit wasteful.\n\n-- \nJakub Narębski\nPoland\n"}]}