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

Re: Caching directories

From
PRPavel Roskin <proski@gnu.org>
Date
Jan 25, 2006, 07:29 UTC
Message-ID
<1138174172.27366.116.camel@dv>
In-Reply-To
<7vvew8zwfe.fsf@assigned-by-dhcp.cox.net>
On Tue, 2006-01-24 at 21:52 -0800, Junio C Hamano wrote:
Show 18 quoted lines
> Pavel Roskin <proski@gnu.org> writes:
> 
> > Maybe it's time to start caching directories in git?  I mean,
> > directories corresponding to tree objects could have their stats
> > recorded in the cache.  This would allow to distinguish between tracked
> > and untracked directories without scanning them recursively.
> 
> I do not understand the above logic.  
> 
> Given a directory path, finding out if the directory has
> something tracked in it is an O(log n) operation in the current
> index that does not "cache directory".  Your message implies
> that you feel we could use the index file to list "untracked
> directories" without recursively scanning the directory tree,
> but to me, the only way to do that is to record a new directory
> in the index file every time somebody (either Makefile or the
> user) creates a junk directory.  That does not make much sense
> to me, so I am probably misreading what you really meant.

Sorry, it looks like my post was based on incorrect assumptions. The new --directory option to git-ls-files seems to be exactly what I want. It allowed me to simplify cg-clean immensely. Further simplification will be possible once the support for .gitignore in parent directories is fixed.

> I have no idea what 'clean' does, so would not comment on that
> part of your message.
It means removing untracked files and directories.
-- 
Regards,
Pavel Roskin
Previous: Junio C Hamano
Message 3 of 3 in “Caching directories”
  1. Pavel RoskinJan 24, 2006
  2. Junio C HamanoJan 25, 2006
  3. Pavel RoskinJan 25, 2006

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.