Caching directories
- From
- Pavel Roskin <proski@gnu.org>
- Date
- Jan 24, 2006, 04:20 UTC
- Message-ID
- <1138076423.15105.36.camel@dv>
Hello!
I'm thinking of moving cg-clean functionality to git. After having switched to StGIT, it's the last cogito command I'm still using. I think git can go it much better, since it's a recursive command traversing the whole repository.
To be safe and useful, the new command should distinguish between tracked and untracked directories. Untracked files in tracked directories are usually the first target for cleaning, as they are mostly automatic backups and temporary files. Untracked directories are more likely candidates to be preserved, as they can hold external sources, build output, extensive test data etc.
cg-clean considers a directory untracked if it has no cached files in it. This carries a significant speed penalty, even if not coded in bash.
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.
-- Regards, Pavel Roskin