From: Linus Torvalds Date: Tue, 03 May 2005 02:56:11 GMT Subject: Re: [PATCH] Git-prune-script loses blobs referenced from an uncommitted cache. Message-ID: In-Reply-To: <7vis21no03.fsf@assigned-by-dhcp.cox.net> On Mon, 2 May 2005, Junio C Hamano wrote: > > When a new blob is registered with update-cache, and before the cache > is written as a tree and committed, git-fsck-cache will find the blob > unreachable. This patch fixes git-prune-script to keep such blob objects > referenced from the cache. Actually, I'd almost rather just have git-fsck-cache actually do a "read_cache()" and walk through that and marking the sha1's as "needed". That's useful for another reason: not only does it mean that we don't drop objects that may be in the current index, but it _also_ means that we check that the current index actually has everything that it needs. I had that situation a few times after I did a "convert-cache" - where I had an old index file that pointed to the old objects _before_ the conversion. I noticed it the hard way, and happily it's easily fixed by just doing a "git-read-cache ", but it was actually very confusing when it happened, and it would have been good to have fsck-cache warn about it. Linus