{"thread":{"id":"43406","subject":"[PATCH] gitweb: Finish restoring \"blob\" links in git_difftree_body","startedAt":"2006-11-19T21:51:39Z","lastAt":"2006-11-19T21:51:39Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"294642","messageId":"1163973099476-git-send-email-jnareb@gmail.com","threadId":"43406","inReplyTo":null,"subject":"[PATCH] gitweb: Finish restoring \"blob\" links in git_difftree_body","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-19T21:51:39Z","receivedAt":"2006-11-19T21:51:39Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"This finishes work started by commit 4777b0141a4812177390da4b6ebc9d40ac3da4b5\n  \"gitweb: Restore object-named links in item lists\"\nby Petr Baudis. It brings back rest of \"blob\" links in difftree-raw\nlike part of \"commit\" and \"commitdiff\" views, namely in\ngit_difftree_body subroutine.\n\nNow the td.link table cell has the following links:\n * link to diff (\"blobdiff\" view) in \"commit\" view, if applicable\n   (there is no link to uninteresting creation/deletion diff), or\n   link to patch anchor in \"commitdiff\" view.\n * link to current version of file (\"blob\" view), with the obvious\n   exception of file deletion, where it is link to the parent\n   version.\n * link to \"blame\" view, if it is enabled, and file was not just\n   created (i.e. it has any history).\n * link to history of the file (\"history\" view), again with sole\n   exception of the case of new file.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis goes in the opposite version to the previous patch\n  \" gitweb: Remove redundant \"blob\" links from git_difftree_body\"\nin the 10/n series.\n\n gitweb/gitweb.perl |   42 +++++++++++++++++++++---------------------\n 1 files changed, 21 insertions(+), 21 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex a32a6b7..ce185d9 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2092,7 +2092,11 @@ sub git_difftree_body {\n \t\t\t\t# link to patch\n \t\t\t\t$patchno++;\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{'to_id'},\n+\t\t\t                             hash_base=>$hash, file_name=>$diff{'file'})},\n+\t\t\t              \"blob\") . \" | \";\n \t\t\tprint \"</td>\\n\";\n \n \t\t} elsif ($diff{'status'} eq \"D\") { # deleted\n@@ -2112,13 +2116,11 @@ sub git_difftree_body {\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\t              \"blob\") . \" | \";\n \t\t\tif ($have_blame) {\n-\t\t\t\tprint $cgi->a({-href =>\n-\t\t\t\t\t\t   href(action=>\"blame\",\n-\t\t\t\t\t\t\thash_base=>$parent,\n-\t\t\t\t\t\t\tfile_name=>$diff{'file'})},\n-\t\t\t\t\t      \"blame\") . \" | \";\n+\t\t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$parent,\n+\t\t\t\t                             file_name=>$diff{'file'})},\n+\t\t\t\t              \"blame\") . \" | \";\n \t\t\t}\n \t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$parent,\n \t\t\t                             file_name=>$diff{'file'})},\n@@ -2163,13 +2165,12 @@ sub git_difftree_body {\n \t\t\t\t      \" | \";\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\t                             hash_base=>$hash, file_name=>$diff{'file'})},\n+\t\t\t               \"blob\") . \" | \";\n \t\t\tif ($have_blame) {\n-\t\t\t\tprint $cgi->a({-href => href(action=>\"blame\",\n-\t\t\t\t\t\t\t     hash_base=>$hash,\n-\t\t\t\t\t\t\t     file_name=>$diff{'file'})},\n-\t\t\t\t\t      \"blame\") . \" | \";\n+\t\t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$hash,\n+\t\t\t\t                             file_name=>$diff{'file'})},\n+\t\t\t\t              \"blame\") . \" | \";\n \t\t\t}\n \t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash,\n \t\t\t                             file_name=>$diff{'file'})},\n@@ -2208,17 +2209,16 @@ sub git_difftree_body {\n \t\t\t\t              \"diff\") .\n \t\t\t\t      \" | \";\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=>\"blob\", hash=>$diff{'to_id'},\n+\t\t\t                             hash_base=>$parent, file_name=>$diff{'to_file'})},\n+\t\t\t              \"blob\") . \" | \";\n \t\t\tif ($have_blame) {\n-\t\t\t\tprint $cgi->a({-href => href(action=>\"blame\",\n-\t\t\t\t\t\t\t     hash_base=>$hash,\n-\t\t\t\t\t\t\t     file_name=>$diff{'to_file'})},\n-\t\t\t\t\t      \"blame\") . \" | \";\n+\t\t\t\tprint $cgi->a({-href => href(action=>\"blame\", hash_base=>$hash,\n+\t\t\t\t                             file_name=>$diff{'to_file'})},\n+\t\t\t\t              \"blame\") . \" | \";\n \t\t\t}\n-\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$parent,\n-\t\t\t                            file_name=>$diff{'from_file'})},\n+\t\t\tprint $cgi->a({-href => href(action=>\"history\", hash_base=>$hash,\n+\t\t\t                            file_name=>$diff{'to_file'})},\n \t\t\t              \"history\");\n \t\t\tprint \"</td>\\n\";\n \n-- \n1.4.3.4\n"}]}