Re: [PATCH 7/8] config: add core.untrackedCache
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 17, 2015, 12:26 UTC
- Message-ID
- <CACsJy8BwARfGmGBXEdWHnDxxXcubZDzjCg7Zy6qD0qzHZWGoFw@mail.gmail.com>
- In-Reply-To
- <20151217074443.GA4830@sigill.intra.peff.net>
On Thu, Dec 17, 2015 at 2:44 PM, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> I think we may actually be thinking of the same thing. Naively, I would > expect: > > .. > - if there is cache data in the index but that config flag is not set, > presumably we would not update it (we could even explicitly drop it, > but my understanding is that is not necessary for correctness, but > only as a possible optimization).
No, if somebody adds or removes something from the index, we either update or drop it, or it's stale. There's the invalidate_untracked() or something in dir.c that we can hook in, check config var and do that. And because config is cached recently, it should be a cheap operation.
Apart from that the idea is fine.
> You could have a config option for "if there is a cache there, pretend > it isn't and ignore it", but I don't see much point.
-- Duy