git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 17, 2007, 05:25 UTC
Message-ID
<20071017052514.GW13801@spearce.org>
In-Reply-To
<562B5254-2BE7-43DF-AB62-499458E360CC@vicaya.com>
Luke Lu <git@vicaya.com> wrote:
Show 13 quoted lines
> 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.
Previous: Shawn O. Pearce
Message 5 of 5 in “gitweb: speed up project listing on large work trees by limiting find depth”
  1. gitweb: speed up project listing on large work trees by limiting find depthLuke Lu, Oct 17, 2007
  2. Shawn O. PearceOct 17, 2007
  3. Luke LuOct 17, 2007
  4. Shawn O. PearceOct 17, 2007
  5. Shawn O. PearceOct 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.