{"thread":{"id":"4723","subject":"[PATCH] Speed up history generation","startedAt":"2006-07-01T00:59:24Z","lastAt":"2006-07-01T01:52:04Z","messageCount":6,"participants":["Luben Tuikov","Junio C Hamano","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22953","messageId":"20060701005924.7726.qmail@web31812.mail.mud.yahoo.com","threadId":"4723","inReplyTo":null,"subject":"[PATCH] Speed up history generation","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-01T00:59:24Z","receivedAt":"2006-07-01T00:59:24Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"Speed up history generation as suggested by Linus.\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.cgi |    9 ++-------\n 1 files changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 035e76d..2705a93 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -2295,16 +2295,12 @@ sub git_history {\n \t      \"</div>\\n\";\n \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n \n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n\\'$file_name\\'\";\n-\tmy $commit;\n+\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n \tprint \"<table cellspacing=\\\"0\\\">\\n\";\n \tmy $alternate = 0;\n \twhile (my $line = <$fd>) {\n \t\tif ($line =~ m/^([0-9a-fA-F]{40})/){\n-\t\t\t$commit = $1;\n-\t\t\tnext;\n-\t\t}\n-\t\tif ($line =~ m/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\\t(.*)$/ &&\n(defined $commit)) {\n+\t\t\tmy $commit = $1;\n \t\t\tmy %co = git_read_commit($commit);\n \t\t\tif (!%co) {\n \t\t\t\tnext;\n@@ -2336,7 +2332,6 @@ sub git_history {\n \t\t\t}\n \t\t\tprint \"</td>\\n\" .\n \t\t\t      \"</tr>\\n\";\n-\t\t\tundef $commit;\n \t\t}\n \t}\n \tprint \"</table>\\n\";\n-- \n1.4.1.rc2.g4ce4\n"},{"id":"22955","messageId":"7v7j2ygmou.fsf@assigned-by-dhcp.cox.net","threadId":"4723","inReplyTo":"20060701005924.7726.qmail@web31812.mail.mud.yahoo.com","subject":"Re: [PATCH] Speed up history generation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-01T01:04:33Z","receivedAt":"2006-07-01T01:04:33Z","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> Speed up history generation as suggested by Linus.\n> @@ -2295,16 +2295,12 @@ sub git_history {\n>  \t      \"</div>\\n\";\n>  \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n>  \n> -\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n> \\'$file_name\\'\";\n> -\tmy $commit;\n> +\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n\nThis would speed things up but at the same time it changes the\nsemantics because it involves merge simplification, no?\n\nAt least that should be noted in the commit log.\n"},{"id":"22956","messageId":"20060701011112.892.qmail@web31813.mail.mud.yahoo.com","threadId":"4723","inReplyTo":"7v7j2ygmou.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Speed up history generation","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-01T01:11:12Z","receivedAt":"2006-07-01T01:11:12Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n> > Speed up history generation as suggested by Linus.\n> > @@ -2295,16 +2295,12 @@ sub git_history {\n> >  \t      \"</div>\\n\";\n> >  \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n> >  \n> > -\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n> > \\'$file_name\\'\";\n> > -\tmy $commit;\n> > +\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n> \n> This would speed things up but at the same time it changes the\n> semantics because it involves merge simplification, no?\n> \n> At least that should be noted in the commit log.\n\nOk, I guess this should be in the log.  Can you add it please when\ncommiting to the master git branch?\n\n   Luben\n"},{"id":"22957","messageId":"Pine.LNX.4.64.0606301818480.12404@g5.osdl.org","threadId":"4723","inReplyTo":"7v7j2ygmou.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Speed up history generation","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-01T01:20:21Z","receivedAt":"2006-07-01T01:20:21Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 30 Jun 2006, Junio C Hamano wrote:\n\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n> > Speed up history generation as suggested by Linus.\n> > @@ -2295,16 +2295,12 @@ sub git_history {\n> >  \t      \"</div>\\n\";\n> >  \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n> >  \n> > -\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n> > \\'$file_name\\'\";\n> > -\tmy $commit;\n> > +\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n> \n> This would speed things up but at the same time it changes the\n> semantics because it involves merge simplification, no?\n\nOr just add a flag or config option that enables \"--full-history\" on that \ngit-rev-list. Perhaps it should be the default fir gitweb.\n\nWith --full-history, it should still be better to do this inside \ngit-rev-list than piping things into git-diff-tree just to limit by \npathname..\n\n\t\tLinus\n"},{"id":"22958","messageId":"7v3bdmglxo.fsf@assigned-by-dhcp.cox.net","threadId":"4723","inReplyTo":"20060701011112.892.qmail@web31813.mail.mud.yahoo.com","subject":"Re: [PATCH] Speed up history generation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-01T01:20:51Z","receivedAt":"2006-07-01T01:20:51Z","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> --- Junio C Hamano <junkio@cox.net> wrote:\n>...\n>> > @@ -2295,16 +2295,12 @@ sub git_history {\n>> >  \t      \"</div>\\n\";\n>> >  \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n>> >  \n>> > -\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n>> > \\'$file_name\\'\";\n>> > -\tmy $commit;\n>> > +\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n>> \n>> This would speed things up but at the same time it changes the\n>> semantics because it involves merge simplification, no?\n>> \n>> At least that should be noted in the commit log.\n>\n> Ok, I guess this should be in the log.  Can you add it please when\n> commiting to the master git branch?\n\nWell, by \"at least\", what I meant was that it might make sense\nto pass \"--full-history\" option to be more compatible with the\noriginal output.  For graphical output like gitk, --full-history\nmakes a mess on the screen, but a list-oriented output like\ngitweb it might be less confusing to show all the alternate\npaths that touched the path than leaving some histories out.\n"},{"id":"22959","messageId":"20060701015204.17216.qmail@web31813.mail.mud.yahoo.com","threadId":"4723","inReplyTo":"7v3bdmglxo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Speed up history generation","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-01T01:52:04Z","receivedAt":"2006-07-01T01:52:04Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n> > --- Junio C Hamano <junkio@cox.net> wrote:\n> >...\n> >> > @@ -2295,16 +2295,12 @@ sub git_history {\n> >> >  \t      \"</div>\\n\";\n> >> >  \tprint \"<div class=\\\"page_path\\\"><b>/\" . esc_html($file_name) . \"</b><br/></div>\\n\";\n> >> >  \n> >> > -\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin --\n> >> > \\'$file_name\\'\";\n> >> > -\tmy $commit;\n> >> > +\topen my $fd, \"-|\", \"$gitbin/git-rev-list $hash -- \\'$file_name\\'\";\n> >> \n> >> This would speed things up but at the same time it changes the\n> >> semantics because it involves merge simplification, no?\n> >> \n> >> At least that should be noted in the commit log.\n> >\n> > Ok, I guess this should be in the log.  Can you add it please when\n> > commiting to the master git branch?\n> \n> Well, by \"at least\", what I meant was that it might make sense\n> to pass \"--full-history\" option to be more compatible with the\n> original output.  For graphical output like gitk, --full-history\n> makes a mess on the screen, but a list-oriented output like\n> gitweb it might be less confusing to show all the alternate\n> paths that touched the path than leaving some histories out.\n\nOk, I can add the --full-history option, test it out and resubmit.\n\n    Luben\n"}]}