From: Jeff King Date: Mon, 20 Feb 2012 14:06:53 GMT Subject: Re: git status: small difference between stating whole repository and small subdirectory Message-ID: <20120220140653.GC5131@sigill.intra.peff.net> In-Reply-To: On Mon, Feb 20, 2012 at 09:25:00AM +0100, Piotr Krukowiecki wrote: > Is the cache set? Not sure how to check it. t0090-cache-tree.sh uses > test-dump-cache-tree and executes "read-tree HEAD" to establish the > cache, but in my case read-tree does not make the cache dumpable (but > it improves status performance). > > $ test-dump-cache-tree | wc -l > 0 > $ git read-tree HEAD > $ test-dump-cache-tree | wc -l > 0 > $ echo 3 | sudo tee /proc/sys/vm/drop_caches && time git status -- . > [...] > real 0m1.085s Hmm. I would think test-dump-cache-tree would do it. I don't know why read-tree wouldn't fill it in, though. Interestingly, on my git.git repo, I had an empty cache. Running "git read-tree HEAD" filled it (according to test-dump-cache-tree). It seems that running "git checkout" empties the cache. So perhaps git could do better about keeping the cache valid over time. -Peff