* [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8
@ 2006-10-05 1:02 Luben Tuikov
2006-10-05 1:24 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Luben Tuikov @ 2006-10-05 1:02 UTC (permalink / raw
To: git
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
Print eight spaces when no leading commit is being printed.
I.e. on all rows of a commit-block, but the first. This fixes
alignment in the destination buffer when blame data lines
are cut and pasted.
Also, now all rows have title.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
gitweb/gitweb.perl | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
[-- Attachment #2: 1908141687-p2.txt --]
[-- Type: text/plain, Size: 898 bytes --]
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 451bf5d..2949fa4 100644
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2510,15 +2510,12 @@ HTML
$print_c8 = 1;
}
print "<tr class=\"$rev_color[$current_color]\">";
- print "<td class=\"sha1\"";
- if ($print_c8 == 1) {
- print " title=\"$author, $date\"";
- }
- print ">";
- if ($print_c8 == 1) {
- print $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
- esc_html($rev));
+ print "<td class=\"sha1\" title=\"$author, $date\">";
+ if ($print_c8 == 0) {
+ $rev = " ";
}
+ print $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)},
+ esc_html($rev));
print "</td>";
print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" .
esc_html($lineno) . "</a></td>";
--
1.4.2.3.g7d77
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8
2006-10-05 1:02 [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8 Luben Tuikov
@ 2006-10-05 1:24 ` Junio C Hamano
2006-10-05 1:29 ` Luben Tuikov
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-10-05 1:24 UTC (permalink / raw
To: ltuikov; +Cc: git
Luben Tuikov <ltuikov@yahoo.com> writes:
> Print eight spaces when no leading commit is being printed.
> I.e. on all rows of a commit-block, but the first. This fixes
> alignment in the destination buffer when blame data lines
> are cut and pasted.
>
> Also, now all rows have title.
Its visuals might be Ok (I haven't had chance to try it), but I
am a bit worried about the output size bloat. What kind of
bloat factor are we talking about with this patch?
- compared to the ancient original, which used to have commit-8
on all lines, title * N lines for a file that is N lines
long. A title ("$author, $date") is about say 30 bytes or so
so for a file that is on average 25 bytes per line (this is
from "wc *.c" in git.git repository ) we are now spewing out
roughly twice the bytes back to the browser (25+8 vs 25+8+30)
- compared to "only first in the block" version, assuming an
average group size is 10 lines or so (this is a totally made
up number) we are adding 72 extra bytes per 10 lines for
commit-8 on top of the title bloat which would be 270 bytes
per 10 lines. Again assuming 25-byte per line average, that
is 250+8+30 vs 250+80+300 per 10 lines. Again, roughly
twice.
I am not sure what the numbers of the chunked one I just
reverted from "next" compared to the original. For the same
group size assumption, it added 8 bytes for commit-8 and 30
bytes for title per the N lines, but we are assuming 10-line
blocks, so 38 byte overhead per 10 lines, which is 250+80 vs
250+38, so it might have been actually slimmer than the
original.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8
2006-10-05 1:24 ` Junio C Hamano
@ 2006-10-05 1:29 ` Luben Tuikov
0 siblings, 0 replies; 3+ messages in thread
From: Luben Tuikov @ 2006-10-05 1:29 UTC (permalink / raw
To: Junio C Hamano; +Cc: git
--- Junio C Hamano <junkio@cox.net> wrote:
> Its visuals might be Ok (I haven't had chance to try it), but I
> am a bit worried about the output size bloat. What kind of
> bloat factor are we talking about with this patch?
>
> - compared to the ancient original, which used to have commit-8
> on all lines, title * N lines for a file that is N lines
> long. A title ("$author, $date") is about say 30 bytes or so
> so for a file that is on average 25 bytes per line (this is
> from "wc *.c" in git.git repository ) we are now spewing out
> roughly twice the bytes back to the browser (25+8 vs 25+8+30)
>
> - compared to "only first in the block" version, assuming an
> average group size is 10 lines or so (this is a totally made
> up number) we are adding 72 extra bytes per 10 lines for
> commit-8 on top of the title bloat which would be 270 bytes
> per 10 lines. Again assuming 25-byte per line average, that
> is 250+8+30 vs 250+80+300 per 10 lines. Again, roughly
> twice.
>
> I am not sure what the numbers of the chunked one I just
> reverted from "next" compared to the original. For the same
> group size assumption, it added 8 bytes for commit-8 and 30
> bytes for title per the N lines, but we are assuming 10-line
> blocks, so 38 byte overhead per 10 lines, which is 250+80 vs
> 250+38, so it might have been actually slimmer than the
> original.
Yes, I agree with you. That patch adds bloat. I agree with
you, we can print the "title=" only for the leading commit-8,
as we currently do, and dispense with 8 SP. In effect this
patch 2/2 can be dropped.
Thanks,
Luben
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-05 1:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 1:02 [PATCH 2/2] gitweb: blame: All rows have title; print 8 SP when no leading commit-8 Luben Tuikov
2006-10-05 1:24 ` Junio C Hamano
2006-10-05 1:29 ` Luben Tuikov
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).