* [PATCH] Speed up history generation
@ 2006-07-01 0:59 Luben Tuikov
2006-07-01 1:04 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Luben Tuikov @ 2006-07-01 0:59 UTC (permalink / raw)
To: git
Speed up history generation as suggested by Linus.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
gitweb/gitweb.cgi | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 035e76d..2705a93 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -2295,16 +2295,12 @@ sub git_history {
"</div>\n";
print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
- open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
\'$file_name\'";
- my $commit;
+ open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
print "<table cellspacing=\"0\">\n";
my $alternate = 0;
while (my $line = <$fd>) {
if ($line =~ m/^([0-9a-fA-F]{40})/){
- $commit = $1;
- next;
- }
- if ($line =~ m/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$/ &&
(defined $commit)) {
+ my $commit = $1;
my %co = git_read_commit($commit);
if (!%co) {
next;
@@ -2336,7 +2332,6 @@ sub git_history {
}
print "</td>\n" .
"</tr>\n";
- undef $commit;
}
}
print "</table>\n";
--
1.4.1.rc2.g4ce4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] Speed up history generation
2006-07-01 0:59 [PATCH] Speed up history generation Luben Tuikov
@ 2006-07-01 1:04 ` Junio C Hamano
2006-07-01 1:11 ` Luben Tuikov
2006-07-01 1:20 ` Linus Torvalds
0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2006-07-01 1:04 UTC (permalink / raw)
To: ltuikov; +Cc: git
Luben Tuikov <ltuikov@yahoo.com> writes:
> Speed up history generation as suggested by Linus.
> @@ -2295,16 +2295,12 @@ sub git_history {
> "</div>\n";
> print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
>
> - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
> \'$file_name\'";
> - my $commit;
> + open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
This would speed things up but at the same time it changes the
semantics because it involves merge simplification, no?
At least that should be noted in the commit log.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Speed up history generation
2006-07-01 1:04 ` Junio C Hamano
@ 2006-07-01 1:11 ` Luben Tuikov
2006-07-01 1:20 ` Junio C Hamano
2006-07-01 1:20 ` Linus Torvalds
1 sibling, 1 reply; 6+ messages in thread
From: Luben Tuikov @ 2006-07-01 1:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
--- Junio C Hamano <junkio@cox.net> wrote:
> Luben Tuikov <ltuikov@yahoo.com> writes:
>
> > Speed up history generation as suggested by Linus.
> > @@ -2295,16 +2295,12 @@ sub git_history {
> > "</div>\n";
> > print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
> >
> > - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
> > \'$file_name\'";
> > - my $commit;
> > + open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
>
> This would speed things up but at the same time it changes the
> semantics because it involves merge simplification, no?
>
> At least that should be noted in the commit log.
Ok, I guess this should be in the log. Can you add it please when
commiting to the master git branch?
Luben
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Speed up history generation
2006-07-01 1:11 ` Luben Tuikov
@ 2006-07-01 1:20 ` Junio C Hamano
2006-07-01 1:52 ` Luben Tuikov
0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2006-07-01 1:20 UTC (permalink / raw)
To: ltuikov; +Cc: git
Luben Tuikov <ltuikov@yahoo.com> writes:
> --- Junio C Hamano <junkio@cox.net> wrote:
>...
>> > @@ -2295,16 +2295,12 @@ sub git_history {
>> > "</div>\n";
>> > print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
>> >
>> > - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
>> > \'$file_name\'";
>> > - my $commit;
>> > + open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
>>
>> This would speed things up but at the same time it changes the
>> semantics because it involves merge simplification, no?
>>
>> At least that should be noted in the commit log.
>
> Ok, I guess this should be in the log. Can you add it please when
> commiting to the master git branch?
Well, by "at least", what I meant was that it might make sense
to pass "--full-history" option to be more compatible with the
original output. For graphical output like gitk, --full-history
makes a mess on the screen, but a list-oriented output like
gitweb it might be less confusing to show all the alternate
paths that touched the path than leaving some histories out.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] Speed up history generation
2006-07-01 1:20 ` Junio C Hamano
@ 2006-07-01 1:52 ` Luben Tuikov
0 siblings, 0 replies; 6+ messages in thread
From: Luben Tuikov @ 2006-07-01 1:52 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
--- Junio C Hamano <junkio@cox.net> wrote:
> Luben Tuikov <ltuikov@yahoo.com> writes:
>
> > --- Junio C Hamano <junkio@cox.net> wrote:
> >...
> >> > @@ -2295,16 +2295,12 @@ sub git_history {
> >> > "</div>\n";
> >> > print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
> >> >
> >> > - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
> >> > \'$file_name\'";
> >> > - my $commit;
> >> > + open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
> >>
> >> This would speed things up but at the same time it changes the
> >> semantics because it involves merge simplification, no?
> >>
> >> At least that should be noted in the commit log.
> >
> > Ok, I guess this should be in the log. Can you add it please when
> > commiting to the master git branch?
>
> Well, by "at least", what I meant was that it might make sense
> to pass "--full-history" option to be more compatible with the
> original output. For graphical output like gitk, --full-history
> makes a mess on the screen, but a list-oriented output like
> gitweb it might be less confusing to show all the alternate
> paths that touched the path than leaving some histories out.
Ok, I can add the --full-history option, test it out and resubmit.
Luben
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Speed up history generation
2006-07-01 1:04 ` Junio C Hamano
2006-07-01 1:11 ` Luben Tuikov
@ 2006-07-01 1:20 ` Linus Torvalds
1 sibling, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2006-07-01 1:20 UTC (permalink / raw)
To: Junio C Hamano; +Cc: ltuikov, git
On Fri, 30 Jun 2006, Junio C Hamano wrote:
> Luben Tuikov <ltuikov@yahoo.com> writes:
>
> > Speed up history generation as suggested by Linus.
> > @@ -2295,16 +2295,12 @@ sub git_history {
> > "</div>\n";
> > print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
> >
> > - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --
> > \'$file_name\'";
> > - my $commit;
> > + open my $fd, "-|", "$gitbin/git-rev-list $hash -- \'$file_name\'";
>
> This would speed things up but at the same time it changes the
> semantics because it involves merge simplification, no?
Or just add a flag or config option that enables "--full-history" on that
git-rev-list. Perhaps it should be the default fir gitweb.
With --full-history, it should still be better to do this inside
git-rev-list than piping things into git-diff-tree just to limit by
pathname..
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-07-01 1:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-01 0:59 [PATCH] Speed up history generation Luben Tuikov
2006-07-01 1:04 ` Junio C Hamano
2006-07-01 1:11 ` Luben Tuikov
2006-07-01 1:20 ` Junio C Hamano
2006-07-01 1:52 ` Luben Tuikov
2006-07-01 1:20 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox