Re: git status: small difference between stating whole repository and small subdirectory
- From
Jeff King <peff@peff.net>
- Date
- Feb 20, 2012, 14:22 UTC
- Message-ID
- <20120220142206.GA5775@sigill.intra.peff.net>
- In-Reply-To
- <CACsJy8AHEHDAa2v4DvNgwd1YsBQuRCL9bHaxF70L8O4yWc4gZg@mail.gmail.com>
On Mon, Feb 20, 2012 at 09:16:43PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 10 quoted lines
> On Mon, Feb 20, 2012 at 9:06 PM, Jeff King <peff@peff.net> wrote: > > 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. > > For fast forward case when result index matches 100% destination tree, > yeah we should repopulate cache-tree. "git reset" does that. Not sure > about other cases though. I don't think we can keep track what > subtrees are unchanged after unpack_trees() in order to keep them.
Yeah, doing it after unpack_trees seems crazy. But I really feel like unpack_trees should be able to handle cache updates as it unpacks. It knows what is being updated and what is being merged. But maybe it is more complicated than that; I haven't looked at the code yet.
-Peff