{"thread":{"id":"5813","subject":"[PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8","startedAt":"2006-10-05T01:02:15Z","lastAt":"2006-10-05T01:29:48Z","messageCount":3,"participants":["Luben Tuikov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28222","messageId":"20061005010215.63402.qmail@web31811.mail.mud.yahoo.com","threadId":"5813","inReplyTo":null,"subject":"[PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-10-05T01:02:15Z","receivedAt":"2006-10-05T01:02:15Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"Print eight spaces when no leading commit is being printed.\nI.e. on all rows of a commit-block, but the first.  This fixes\nalignment in the destination buffer when blame data lines\nare cut and pasted.\n\nAlso, now all rows have title.\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.perl |   13 +++++--------\n 1 files changed, 5 insertions(+), 8 deletions(-)\n\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 451bf5d..2949fa4 100644\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2510,15 +2510,12 @@ HTML\n \t\t\t$print_c8 = 1;\n \t\t}\n \t\tprint \"<tr class=\\\"$rev_color[$current_color]\\\">\";\n-\t\tprint \"<td class=\\\"sha1\\\"\";\n-\t\tif ($print_c8 == 1) {\n-\t\t\tprint \" title=\\\"$author, $date\\\"\";\n-\t\t}\n-\t\tprint \">\";\n-\t\tif ($print_c8 == 1) {\n-\t\t\tprint $cgi->a({-href => href(action=>\"commit\", hash=>$full_rev, file_name=>$file_name)},\n-\t\t\t\t      esc_html($rev));\n+\t\tprint \"<td class=\\\"sha1\\\" title=\\\"$author, $date\\\">\";\n+\t\tif ($print_c8 == 0) {\n+\t\t\t$rev = \"        \";\n \t\t}\n+\t\tprint $cgi->a({-href => href(action=>\"commit\", hash=>$full_rev, file_name=>$file_name)},\n+\t\t\t      esc_html($rev));\n \t\tprint \"</td>\";\n \t\tprint \"<td class=\\\"linenr\\\"><a id=\\\"l$lineno\\\" href=\\\"#l$lineno\\\" class=\\\"linenr\\\">\" .\n \t\t      esc_html($lineno) . \"</a></td>\";\n-- \n1.4.2.3.g7d77\n\n"},{"id":"28224","messageId":"7vwt7fimgs.fsf@assigned-by-dhcp.cox.net","threadId":"5813","inReplyTo":"20061005010215.63402.qmail@web31811.mail.mud.yahoo.com","subject":"Re: [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-05T01:24:19Z","receivedAt":"2006-10-05T01:24:19Z","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> Print eight spaces when no leading commit is being printed.\n> I.e. on all rows of a commit-block, but the first.  This fixes\n> alignment in the destination buffer when blame data lines\n> are cut and pasted.\n>\n> Also, now all rows have title.\n\nIts visuals might be Ok (I haven't had chance to try it), but I\nam a bit worried about the output size bloat.  What kind of\nbloat factor are we talking about with this patch?\n\n - compared to the ancient original, which used to have commit-8\n   on all lines, title * N lines for a file that is N lines\n   long.  A title (\"$author, $date\") is about say 30 bytes or so\n   so for a file that is on average 25 bytes per line (this is\n   from \"wc *.c\" in git.git repository ) we are now spewing out\n   roughly twice the bytes back to the browser (25+8 vs 25+8+30)\n\n - compared to \"only first in the block\" version, assuming an\n   average group size is 10 lines or so (this is a totally made\n   up number) we are adding 72 extra bytes per 10 lines for\n   commit-8 on top of the title bloat which would be 270 bytes\n   per 10 lines.  Again assuming 25-byte per line average, that\n   is 250+8+30 vs 250+80+300 per 10 lines.  Again, roughly\n   twice.\n\nI am not sure what the numbers of the chunked one I just\nreverted from \"next\" compared to the original.  For the same\ngroup size assumption, it added 8 bytes for commit-8 and 30\nbytes for title per the N lines, but we are assuming 10-line\nblocks, so 38 byte overhead per 10 lines, which is 250+80 vs\n250+38, so it might have been actually slimmer than the\noriginal.\n"},{"id":"28225","messageId":"20061005012948.6961.qmail@web31815.mail.mud.yahoo.com","threadId":"5813","inReplyTo":"7vwt7fimgs.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-10-05T01:29:48Z","receivedAt":"2006-10-05T01:29:48Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Its visuals might be Ok (I haven't had chance to try it), but I\n> am a bit worried about the output size bloat.  What kind of\n> bloat factor are we talking about with this patch?\n> \n>  - compared to the ancient original, which used to have commit-8\n>    on all lines, title * N lines for a file that is N lines\n>    long.  A title (\"$author, $date\") is about say 30 bytes or so\n>    so for a file that is on average 25 bytes per line (this is\n>    from \"wc *.c\" in git.git repository ) we are now spewing out\n>    roughly twice the bytes back to the browser (25+8 vs 25+8+30)\n> \n>  - compared to \"only first in the block\" version, assuming an\n>    average group size is 10 lines or so (this is a totally made\n>    up number) we are adding 72 extra bytes per 10 lines for\n>    commit-8 on top of the title bloat which would be 270 bytes\n>    per 10 lines.  Again assuming 25-byte per line average, that\n>    is 250+8+30 vs 250+80+300 per 10 lines.  Again, roughly\n>    twice.\n> \n> I am not sure what the numbers of the chunked one I just\n> reverted from \"next\" compared to the original.  For the same\n> group size assumption, it added 8 bytes for commit-8 and 30\n> bytes for title per the N lines, but we are assuming 10-line\n> blocks, so 38 byte overhead per 10 lines, which is 250+80 vs\n> 250+38, so it might have been actually slimmer than the\n> original.\n\nYes, I agree with you.  That patch adds bloat.  I agree with\nyou, we can print the \"title=\" only for the leading commit-8,\nas we currently do, and dispense with 8 SP.  In effect this\npatch 2/2 can be dropped.\n\nThanks,\n   Luben\n"}]}