Re: [PATCH] Git-prune-script loses blobs referenced from an uncommitted cache.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 3, 2005, 02:56 UTC
- Message-ID
- <Pine.LNX.4.58.0505021953160.3594@ppc970.osdl.org>
- In-Reply-To
- <7vis21no03.fsf@assigned-by-dhcp.cox.net>
On Mon, 2 May 2005, Junio C Hamano wrote:
Show 5 quoted lines
> > 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 <new-head>", but it was actually very confusing when it happened, and it would have been good to have fsck-cache warn about it.
Linus