Re: git status: small difference between stating whole repository and small subdirectory
- From
Jeff King <peff@peff.net>
- Date
- Feb 20, 2012, 14:06 UTC
- Message-ID
- <20120220140653.GC5131@sigill.intra.peff.net>
- In-Reply-To
- <CAA01CsozANwtox06iihKBL8iii175FHAhChmNhG1B0ofGKWcEA@mail.gmail.com>
On Mon, Feb 20, 2012 at 09:25:00AM +0100, Piotr Krukowiecki wrote:
Show 13 quoted lines
> 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