{"thread":{"id":"5726","subject":"[PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","startedAt":"2006-09-28T00:23:25Z","lastAt":"2006-10-02T19:48:47Z","messageCount":5,"participants":["Luben Tuikov","Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27838","messageId":"20060928002325.70519.qmail@web31815.mail.mud.yahoo.com","threadId":"5726","inReplyTo":null,"subject":"[PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-09-28T00:23:25Z","receivedAt":"2006-09-28T00:23:25Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"1) All entries on the left are blobs and clicking on them\nleads to blobs.  No more diff or blob depending on what\nhappened (modified or mode changed) to the file -- this goes\nto the right, in the \"link\" column.\n\n2) Remove redundant \"blob\" from the link column on the right.\nThis can now be had by clicking on the entry itself.\n\nThis reduces and simplifies the code.\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.perl |   92 +++++++++++++++++++---------------------------------\n 1 files changed, 34 insertions(+), 58 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 56638f2..c87f60e 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1692,47 +1692,39 @@ sub git_difftree_body {\n \t\t\tmy $mode_chng = \"<span class=\\\"file_status new\\\">[new $to_file_type\";\n \t\t\t$mode_chng   .= \" with mode: $to_mode_str\" if $to_mode_str;\n \t\t\t$mode_chng   .= \"]</span>\";\n-\t\t\tprint \"<td>\" .\n-\t\t\t      $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n+\t\t\tprint \"<td>\";\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              -class => \"list\"}, esc_html($diff{'file'})) .\n-\t\t\t      \"</td>\\n\" .\n-\t\t\t      \"<td>$mode_chng</td>\\n\" .\n-\t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $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\t\t       -class => \"list\"}, esc_html($diff{'file'}));\n+\t\t\tprint \"</td>\\n\";\n+\t\t\tprint \"<td>$mode_chng</td>\\n\";\n+\t\t\tprint \"<td class=\\\"link\\\">\";\n \t\t\tif ($action eq 'commitdiff') {\n \t\t\t\t# link to patch\n \t\t\t\t$patchno++;\n-\t\t\t\tprint \" | \" .\n-\t\t\t\t      $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t\tprint $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n \t\t\t}\n \t\t\tprint \"</td>\\n\";\n \n \t\t} elsif ($diff{'status'} eq \"D\") { # deleted\n \t\t\tmy $mode_chng = \"<span class=\\\"file_status deleted\\\">[deleted $from_file_type]</span>\";\n-\t\t\tprint \"<td>\" .\n-\t\t\t      $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n+\t\t\tprint \"<td>\";\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               -class => \"list\"}, esc_html($diff{'file'})) .\n-\t\t\t      \"</td>\\n\" .\n-\t\t\t      \"<td>$mode_chng</td>\\n\" .\n-\t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $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              \"blob\") .\n-\t\t\t      \" | \";\n+\t\t\t               -class => \"list\"}, esc_html($diff{'file'}));\n+\t\t\tprint \"</td>\\n\";\n+\t\t\tprint \"<td>$mode_chng</td>\\n\";\n+\t\t\tprint \"<td class=\\\"link\\\">\";\n \t\t\tif ($action eq 'commitdiff') {\n \t\t\t\t# link to patch\n \t\t\t\t$patchno++;\n-\t\t\t\tprint \" | \" .\n-\t\t\t\t      $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\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=>\"history\", hash_base=>$parent,\n \t\t\t                             file_name=>$diff{'file'})},\n-\t\t\t              \"history\") .\n-\t\t\t      \"</td>\\n\";\n+\t\t\t              \"history\");\n+\t\t\tprint \"</td>\\n\";\n \n \t\t} elsif ($diff{'status'} eq \"M\" || $diff{'status'} eq \"T\") { # modified, or type changed\n \t\t\tmy $mode_chnge = \"\";\n@@ -1751,42 +1743,29 @@ sub git_difftree_body {\n \t\t\t\t$mode_chnge .= \"]</span>\\n\";\n \t\t\t}\n \t\t\tprint \"<td>\";\n-\t\t\tif ($diff{'to_id'} ne $diff{'from_id'}) { # modified\n-\t\t\t\tprint $cgi->a({-href => href(action=>\"blobdiff\",\n-\t\t\t\t                             hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n-\t\t\t\t                             hash_base=>$hash, hash_parent_base=>$parent,\n-\t\t\t\t                             file_name=>$diff{'file'}),\n-\t\t\t\t              -class => \"list\"}, esc_html($diff{'file'}));\n-\t\t\t} else { # only mode changed\n-\t\t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'to_id'},\n-\t\t\t\t                             hash_base=>$hash, file_name=>$diff{'file'}),\n-\t\t\t\t              -class => \"list\"}, esc_html($diff{'file'}));\n-\t\t\t}\n-\t\t\tprint \"</td>\\n\" .\n-\t\t\t      \"<td>$mode_chnge</td>\\n\" .\n-\t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $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 $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       -class => \"list\"}, esc_html($diff{'file'}));\n+\t\t\tprint \"</td>\\n\";\n+\t\t\tprint \"<td>$mode_chnge</td>\\n\";\n+\t\t\tprint \"<td class=\\\"link\\\">\";\n \t\t\tif ($diff{'to_id'} ne $diff{'from_id'}) { # modified\n \t\t\t\tif ($action eq 'commitdiff') {\n \t\t\t\t\t# link to patch\n \t\t\t\t\t$patchno++;\n-\t\t\t\t\tprint \" | \" .\n-\t\t\t\t\t\t$cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n+\t\t\t\t\tprint $cgi->a({-href => \"#patch$patchno\"}, \"patch\");\n \t\t\t\t} else {\n-\t\t\t\t\tprint \" | \" .\n-\t\t\t\t\t\t$cgi->a({-href => href(action=>\"blobdiff\",\n-\t\t\t\t\t\t                       hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n-\t\t\t\t\t\t                       hash_base=>$hash, hash_parent_base=>$parent,\n-\t\t\t\t\t\t                       file_name=>$diff{'file'})},\n-\t\t\t\t\t\t        \"diff\");\n+\t\t\t\t\tprint $cgi->a({-href => href(action=>\"blobdiff\",\n+\t\t\t\t\t\t\t\t     hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},\n+\t\t\t\t\t\t\t\t     hash_base=>$hash, hash_parent_base=>$parent,\n+\t\t\t\t\t\t\t\t     file_name=>$diff{'file'})},\n+\t\t\t\t\t\t      \"diff\");\n \t\t\t\t}\n+\t\t\t\tprint \" | \";\n \t\t\t}\n-\t\t\tprint \" | \" .\n-\t\t\t\t$cgi->a({-href => href(action=>\"history\",\n-\t\t\t\t                       hash_base=>$hash, file_name=>$diff{'file'})},\n-\t\t\t\t        \"history\");\n+\t\t\tprint $cgi->a({-href => href(action=>\"history\",\n+\t\t\t\t\t\t     hash_base=>$hash, file_name=>$diff{'file'})},\n+\t\t\t\t      \"history\");\n \t\t\tprint \"</td>\\n\";\n \n \t\t} elsif ($diff{'status'} eq \"R\" || $diff{'status'} eq \"C\") { # renamed or copied\n@@ -1806,10 +1785,7 @@ sub git_difftree_body {\n \t\t\t                             hash=>$diff{'from_id'}, file_name=>$diff{'from_file'}),\n \t\t\t              -class => \"list\"}, esc_html($diff{'from_file'})) .\n \t\t\t      \" with \" . (int $diff{'similarity'}) . \"% similarity$mode_chng]</span></td>\\n\" .\n-\t\t\t      \"<td class=\\\"link\\\">\" .\n-\t\t\t      $cgi->a({-href => href(action=>\"blob\", hash_base=>$hash,\n-\t\t\t                             hash=>$diff{'to_id'}, file_name=>$diff{'to_file'})},\n-\t\t\t              \"blob\");\n+\t\t\t      \"<td class=\\\"link\\\">\";\n \t\t\tif ($diff{'to_id'} ne $diff{'from_id'}) {\n \t\t\t\tif ($action eq 'commitdiff') {\n \t\t\t\t\t# link to patch\n-- \n1.4.2.1.g271e\n\n"},{"id":"27850","messageId":"7vmz8k7nhc.fsf@assigned-by-dhcp.cox.net","threadId":"5726","inReplyTo":"20060928002325.70519.qmail@web31815.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-28T02:07:27Z","receivedAt":"2006-09-28T02:07:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> writes:\n\n> 1) All entries on the left are blobs and clicking on them\n> leads to blobs.  No more diff or blob depending on what\n> happened (modified or mode changed) to the file -- this goes\n> to the right, in the \"link\" column.\n>\n> 2) Remove redundant \"blob\" from the link column on the right.\n> This can now be had by clicking on the entry itself.\n>\n> This reduces and simplifies the code.\n>\n> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>\n\nWe lost blobdiff from commitdiff page with this patch, which I\nthink it probably is a good change.  We can say \"when we display\na pathname you can click it to get the blob or tree\".\n\nBy the way, just like your \"blob\" and \"tree\" link removal, I\nthink we can lose \"commit\" link in shortlog.  The list looks\nrather cluttered with three links; we could replace it with\n\"snapshot\" link if we wanted to.\n\nI am neutral about doing that for long log pages.  The commit\ntitles are links there as well, but they do not look like \"one\nof the columns that can be clicked in a single line per row\ntable\" as in shortlog page.  The page could also get \"snapshot\"\nlinks.\n"},{"id":"27914","messageId":"20060928182843.83600.qmail@web31802.mail.mud.yahoo.com","threadId":"5726","inReplyTo":"7vmz8k7nhc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-09-28T18:28:42Z","receivedAt":"2006-09-28T18:28:42Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> We lost blobdiff from commitdiff page with this patch, which I\n> think it probably is a good change.  We can say \"when we display\n> a pathname you can click it to get the blob or tree\".\n\nI think so too.\n\n> By the way, just like your \"blob\" and \"tree\" link removal, I\n> think we can lose \"commit\" link in shortlog.  The list looks\n> rather cluttered with three links; we could replace it with\n> \"snapshot\" link if we wanted to.\n\nI agree.\n\n   Luben\n\n> I am neutral about doing that for long log pages.  The commit\n> titles are links there as well, but they do not look like \"one\n> of the columns that can be clicked in a single line per row\n> table\" as in shortlog page.  The page could also get \"snapshot\"\n> links.\n> \n> \n> \n> \n> \n"},{"id":"28078","messageId":"efp4d6$a7b$1@sea.gmane.org","threadId":"5726","inReplyTo":"7vmz8k7nhc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-01T19:20:26Z","receivedAt":"2006-10-01T19:20:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n>> 1) All entries on the left are blobs and clicking on them\n>> leads to blobs.  No more diff or blob depending on what\n>> happened (modified or mode changed) to the file -- this goes\n>> to the right, in the \"link\" column.\n>>\n>> 2) Remove redundant \"blob\" from the link column on the right.\n>> This can now be had by clicking on the entry itself.\n>>\n>> This reduces and simplifies the code.\n>>\n>> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>\n> \n> We lost blobdiff from commitdiff page with this patch, which I\n> think it probably is a good change.  We can say \"when we display\n> a pathname you can click it to get the blob or tree\".\n\nIn my opinion it is a bad change. We now have \"patch\" inner-link\nto anchor in commitdiff view, but it's equivalent in commit view\ni.e. diff aka blobdiff vanished.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28116","messageId":"20061002194847.285.qmail@web31811.mail.mud.yahoo.com","threadId":"5726","inReplyTo":"efp4d6$a7b$1@sea.gmane.org","subject":"Re: [PATCH] gitweb: Remove excessively redundant entries from git_difftree_body","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-10-02T19:48:47Z","receivedAt":"2006-10-02T19:48:47Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Jakub Narebski <jnareb@gmail.com> wrote:\n> Junio C Hamano wrote:\n> \n> > Luben Tuikov <ltuikov@yahoo.com> writes:\n> > \n> >> 1) All entries on the left are blobs and clicking on them\n> >> leads to blobs.  No more diff or blob depending on what\n> >> happened (modified or mode changed) to the file -- this goes\n> >> to the right, in the \"link\" column.\n> >>\n> >> 2) Remove redundant \"blob\" from the link column on the right.\n> >> This can now be had by clicking on the entry itself.\n> >>\n> >> This reduces and simplifies the code.\n> >>\n> >> Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>\n> > \n> > We lost blobdiff from commitdiff page with this patch, which I\n> > think it probably is a good change.  We can say \"when we display\n> > a pathname you can click it to get the blob or tree\".\n> \n> In my opinion it is a bad change. We now have \"patch\" inner-link\n> to anchor in commitdiff view, but it's equivalent in commit view\n> i.e. diff aka blobdiff vanished.\n\nAll which can be easily had.\n\n    Luben\n"}]}