Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] gitweb: speed up project listing on large work trees by limiting find depth

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:42

Luke Lu [off-list ref] wrote:
OK, let me try again :) I was using no_chdir => 1 to shorten the tr,  
as well as saving a syscall. However the code is expecting $_ to be  
relative elsewhere (line 1524) to check for the toplevel, so the  
check failed for the toplevel because of no_chdir, which caused  
substr to work on the toplevel, which is $pfxlen long. Note $pfxlen +  
1 passes the end of the toplevel path, hence the errors, though the  
program still worked correctly, as $subdir is undefined in this case,  
which would by pass the rest of the code, which is logically correct.  
It'll probably crash, if it's written in C :)

So, I got rid of no_chdir => 1 in the new patch and uses  
$File::Find::name directly, as otherwise I'd have to come up with a  
messier regex for checking toplevel at line 1524.
*light dawns*.  Thank you for the explanation.

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help