From: Linus Torvalds Date: Tue, 19 Apr 2005 17:41:19 GMT Subject: Re: naive question Message-ID: In-Reply-To: <20050419171534.GH12757@pasky.ji.cz> On Tue, 19 Apr 2005, Petr Baudis wrote: > > I'd actually prefer, if: > > (i) checkout-cache simply wouldn't touch files whose stat matches with > what is in the cache; it updates the cache with the stat informations > of touched files Run "update-cache --refresh" _before_ doing the "checkout-cache", and that is exactly what will happen. But yes, if you want to make checkout-cache update the stat info (Ingo wanted to do that too), it should be possible. The end result is a combination of "update-cache" and "checkout-cache", though: you'll effectively need to both (just in one pass). With the current setup, you have to do update-cache --refresh checkout-cache -f -a update-cache --refresh which is admittedly fairly inefficient. The real expense right now of a merge is that we always forget all the stat information when we do a merge (since it does a read-tree). I have a cunning way to fix that, though, which is to make "read-tree -m" read in the old index state like it used to, and then at the end just throw it away except for the stat information. Linus