{"thread":{"id":"5889","subject":"[PATCH] gitweb: Restore object-named links in item lists","startedAt":"2006-10-11T20:18:13Z","lastAt":"2006-10-11T22:46:37Z","messageCount":4,"participants":["Petr Baudis","Junio C Hamano","Luben Tuikov","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"28625","messageId":"20061011201812.26857.58295.stgit@rover","threadId":"5889","inReplyTo":null,"subject":"[PATCH] gitweb: Restore object-named links in item lists","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-11T20:18:13Z","receivedAt":"2006-10-11T20:18:13Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This restores the redundant links removed earlier. It supersedes my patch\nto stick slashes to tree entries.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n gitweb/gitweb.perl |   42 ++++++++++++++++++++++++++++--------------\n 1 files changed, 28 insertions(+), 14 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex a11fa38..d8298b9 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1785,18 +1785,20 @@ sub git_print_tree_entry {\n \t\t\t\t\t       file_name=>\"$basedir$t->{'name'}\", %base_key),\n \t\t\t\t -class => \"list\"}, esc_html($t->{'name'})) . \"</td>\\n\";\n \t\tprint \"<td class=\\\"link\\\">\";\n+\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$t->{'hash'},\n+\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n+\t\t\t      \"blob\");\n \t\tif ($have_blame) {\n-\t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash=>$t->{'hash'},\n+\t\t\tprint \" | \" .\n+\t\t\t\t$cgi->a({-href => href(action=>\"blame\", hash=>$t->{'hash'},\n \t\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n-\t\t\t\t      \"blame\");\n+\t\t\t\t\t\"blame\");\n \t\t}\n \t\tif (defined $hash_base) {\n-\t\t\tif ($have_blame) {\n-\t\t\t\tprint \" | \";\n-\t\t\t}\n-\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n+\t\t\tprint \" | \" .\n+\t\t\t\t$cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n \t\t\t                             hash=>$t->{'hash'}, file_name=>\"$basedir$t->{'name'}\")},\n-\t\t\t              \"history\");\n+\t\t\t\t\t\"history\");\n \t\t}\n \t\tprint \" | \" .\n \t\t\t$cgi->a({-href => href(action=>\"blob_plain\", hash_base=>$hash_base,\n@@ -1811,17 +1813,19 @@ sub git_print_tree_entry {\n \t\t              esc_html($t->{'name'}));\n \t\tprint \"</td>\\n\";\n \t\tprint \"<td class=\\\"link\\\">\";\n+\t\tprint $cgi->a({-href => href(action=>\"tree\", hash=>$t->{'hash'},\n+\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n+\t\t\t      \"tree\");\n \t\tif (defined $hash_base) {\n-\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n+\t\t\tprint \" | \" .\n+\t\t\t\t$cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n \t\t\t                             file_name=>\"$basedir$t->{'name'}\")},\n-\t\t\t              \"history\");\n-\t\t\tif ($have_snapshot) {\n-\t\t\t\tprint \" | \";\n-\t\t\t}\n+\t\t\t\t\t\"history\");\n \t\t}\n \t\tif ($have_snapshot) {\n-\t\t\tprint $cgi->a({-href => href(action=>\"snapshot\", hash=>$t->{'hash'})},\n-\t\t\t\t      \"snapshot\");\n+\t\t\tprint \" | \" .\n+\t\t\t\t$cgi->a({-href => href(action=>\"snapshot\", hash=>$t->{'hash'})},\n+\t\t\t\t\t\"snapshot\");\n \t\t}\n \t\tprint \"</td>\\n\";\n \t}\n@@ -1902,6 +1906,9 @@ sub git_difftree_body {\n \t\t\t\tprint $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n \t\t\t\tprint \" | \";\n \t\t\t}\n+\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n+\t\t\t                             hash_base=>$parent, file_name=>$diff{'file'})},\n+\t\t\t\t      \"blob\") . \" | \";\n \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$parent,\n \t\t\t\t\t\t     file_name=>$diff{'file'})},\n \t\t\t\t      \"blame\") . \" | \";\n@@ -1947,6 +1954,9 @@ sub git_difftree_body {\n \t\t\t\t}\n \t\t\t\tprint \" | \";\n \t\t\t}\n+\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n+\t\t\t\t\t\t     hash_base=>$hash, file_name=>$diff{'file'})},\n+\t\t\t\t      \"blob\") . \" | \";\n \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$hash,\n \t\t\t\t\t\t     file_name=>$diff{'file'})},\n \t\t\t\t      \"blame\") . \" | \";\n@@ -1987,6 +1997,9 @@ sub git_difftree_body {\n \t\t\t\t}\n \t\t\t\tprint \" | \";\n \t\t\t}\n+\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n+\t\t\t\t\t\t     hash_base=>$parent, file_name=>$diff{'from_file'})},\n+\t\t\t\t      \"blob\") . \" | \";\n \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$parent,\n \t\t\t\t\t\t     file_name=>$diff{'from_file'})},\n \t\t\t\t      \"blame\") . \" | \";\n@@ -2154,6 +2167,7 @@ sub git_shortlog_body {\n \t\t                          href(action=>\"commit\", hash=>$commit), $ref);\n \t\tprint \"</td>\\n\" .\n \t\t      \"<td class=\\\"link\\\">\" .\n+\t\t      $cgi->a({-href => href(action=>\"commit\", hash=>$commit)}, \"commit\") . \" | \" .\n \t\t      $cgi->a({-href => href(action=>\"commitdiff\", hash=>$commit)}, \"commitdiff\") . \" | \" .\n \t\t      $cgi->a({-href => href(action=>\"tree\", hash=>$commit, hash_base=>$commit)}, \"tree\");\n \t\tif (gitweb_have_snapshot()) {\n"},{"id":"28637","messageId":"7viriqsew5.fsf@assigned-by-dhcp.cox.net","threadId":"5889","inReplyTo":"20061011201812.26857.58295.stgit@rover","subject":"Re: [PATCH] gitweb: Restore object-named links in item lists","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-11T21:48:10Z","receivedAt":"2006-10-11T21:48:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I would love to take this but please defer it for now; the patch\ndoes not apply to any of my topic branches (nor \"next\").\n\nI'd like to stabilize \"master\" for v1.4.3 this week, and would\nlike to merge bunch of stuff that are already in \"next\" to\n\"master\" after that.  I'd prefer to come back to gitweb when the\ndust settles.\n"},{"id":"28643","messageId":"20061011222101.36525.qmail@web31808.mail.mud.yahoo.com","threadId":"5889","inReplyTo":"20061011201812.26857.58295.stgit@rover","subject":"Re: [PATCH] gitweb: Restore object-named links in item lists","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-10-11T22:21:01Z","receivedAt":"2006-10-11T22:21:01Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Petr Baudis <pasky@suse.cz> wrote:\n> This restores the redundant links removed earlier. It supersedes my patch\n> to stick slashes to tree entries.\n\nI NACK this, but it depends on Junio.\n\nBTW, if you so much like to bring this back,\nwhy don't you _revert_ the commit which removed them,\n_resolve_, _commit_ and then submit that commit.\n\nThe reason is that we know that the original works\nand here you're rewriting (untested as opposed\nto the original) code.\n\nNACK, I don't see the need for this.\n\nBut if this does go in, can you please remove the\n\"hidden\" links so that _less_ identical code is left\nto be maintained.  (I don't know anyone who's getting\npaid to maintain gitweb, do you?)\n\n   Luben\n\n> \n> Signed-off-by: Petr Baudis <pasky@suse.cz>\n> ---\n> \n>  gitweb/gitweb.perl |   42 ++++++++++++++++++++++++++++--------------\n>  1 files changed, 28 insertions(+), 14 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index a11fa38..d8298b9 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -1785,18 +1785,20 @@ sub git_print_tree_entry {\n>  \t\t\t\t\t       file_name=>\"$basedir$t->{'name'}\", %base_key),\n>  \t\t\t\t -class => \"list\"}, esc_html($t->{'name'})) . \"</td>\\n\";\n>  \t\tprint \"<td class=\\\"link\\\">\";\n> +\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$t->{'hash'},\n> +\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n> +\t\t\t      \"blob\");\n>  \t\tif ($have_blame) {\n> -\t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash=>$t->{'hash'},\n> +\t\t\tprint \" | \" .\n> +\t\t\t\t$cgi->a({-href => href(action=>\"blame\", hash=>$t->{'hash'},\n>  \t\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n> -\t\t\t\t      \"blame\");\n> +\t\t\t\t\t\"blame\");\n>  \t\t}\n>  \t\tif (defined $hash_base) {\n> -\t\t\tif ($have_blame) {\n> -\t\t\t\tprint \" | \";\n> -\t\t\t}\n> -\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n> +\t\t\tprint \" | \" .\n> +\t\t\t\t$cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n>  \t\t\t                             hash=>$t->{'hash'}, file_name=>\"$basedir$t->{'name'}\")},\n> -\t\t\t              \"history\");\n> +\t\t\t\t\t\"history\");\n>  \t\t}\n>  \t\tprint \" | \" .\n>  \t\t\t$cgi->a({-href => href(action=>\"blob_plain\", hash_base=>$hash_base,\n> @@ -1811,17 +1813,19 @@ sub git_print_tree_entry {\n>  \t\t              esc_html($t->{'name'}));\n>  \t\tprint \"</td>\\n\";\n>  \t\tprint \"<td class=\\\"link\\\">\";\n> +\t\tprint $cgi->a({-href => href(action=>\"tree\", hash=>$t->{'hash'},\n> +\t\t\t\t\t     file_name=>\"$basedir$t->{'name'}\", %base_key)},\n> +\t\t\t      \"tree\");\n>  \t\tif (defined $hash_base) {\n> -\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n> +\t\t\tprint \" | \" .\n> +\t\t\t\t$cgi->a({-href => href(action=>\"history\", hash_base=>$hash_base,\n>  \t\t\t                             file_name=>\"$basedir$t->{'name'}\")},\n> -\t\t\t              \"history\");\n> -\t\t\tif ($have_snapshot) {\n> -\t\t\t\tprint \" | \";\n> -\t\t\t}\n> +\t\t\t\t\t\"history\");\n>  \t\t}\n>  \t\tif ($have_snapshot) {\n> -\t\t\tprint $cgi->a({-href => href(action=>\"snapshot\", hash=>$t->{'hash'})},\n> -\t\t\t\t      \"snapshot\");\n> +\t\t\tprint \" | \" .\n> +\t\t\t\t$cgi->a({-href => href(action=>\"snapshot\", hash=>$t->{'hash'})},\n> +\t\t\t\t\t\"snapshot\");\n>  \t\t}\n>  \t\tprint \"</td>\\n\";\n>  \t}\n> @@ -1902,6 +1906,9 @@ sub git_difftree_body {\n>  \t\t\t\tprint $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n>  \t\t\t\tprint \" | \";\n>  \t\t\t}\n> +\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n> +\t\t\t                             hash_base=>$parent, file_name=>$diff{'file'})},\n> +\t\t\t\t      \"blob\") . \" | \";\n>  \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$parent,\n>  \t\t\t\t\t\t     file_name=>$diff{'file'})},\n>  \t\t\t\t      \"blame\") . \" | \";\n> @@ -1947,6 +1954,9 @@ sub git_difftree_body {\n>  \t\t\t\t}\n>  \t\t\t\tprint \" | \";\n>  \t\t\t}\n> +\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n> +\t\t\t\t\t\t     hash_base=>$hash, file_name=>$diff{'file'})},\n> +\t\t\t\t      \"blob\") . \" | \";\n>  \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$hash,\n>  \t\t\t\t\t\t     file_name=>$diff{'file'})},\n>  \t\t\t\t      \"blame\") . \" | \";\n> @@ -1987,6 +1997,9 @@ sub git_difftree_body {\n>  \t\t\t\t}\n>  \t\t\t\tprint \" | \";\n>  \t\t\t}\n> +\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n> +\t\t\t\t\t\t     hash_base=>$parent, file_name=>$diff{'from_file'})},\n> +\t\t\t\t      \"blob\") . \" | \";\n>  \t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$parent,\n>  \t\t\t\t\t\t     file_name=>$diff{'from_file'})},\n>  \t\t\t\t      \"blame\") . \" | \";\n> @@ -2154,6 +2167,7 @@ sub git_shortlog_body {\n>  \t\t                          href(action=>\"commit\", hash=>$commit), $ref);\n>  \t\tprint \"</td>\\n\" .\n>  \t\t      \"<td class=\\\"link\\\">\" .\n> +\t\t      $cgi->a({-href => href(action=>\"commit\", hash=>$commit)}, \"commit\") . \" | \" .\n>  \t\t      $cgi->a({-href => href(action=>\"commitdiff\", hash=>$commit)}, \"commitdiff\") . \" | \" .\n>  \t\t      $cgi->a({-href => href(action=>\"tree\", hash=>$commit, hash_base=>$commit)}, \"tree\");\n>  \t\tif (gitweb_have_snapshot()) {\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"28644","messageId":"egjs8b$tmh$1@sea.gmane.org","threadId":"5889","inReplyTo":"20061011222101.36525.qmail@web31808.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb: Restore object-named links in item lists","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-11T22:46:37Z","receivedAt":"2006-10-11T22:46:37Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Luben Tuikov wrote:\n\n> But if this does go in, can you please remove the\n> \"hidden\" links so that _less_ identical code is left\n> to be maintained.  (I don't know anyone who's getting\n> paid to maintain gitweb, do you?)\n\nWe could instead save common part of links in the temporary\nvariable. I quite like those \"hidden links\", they make area where\nwe can click larger.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}