git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C Hamano
Message 2 of 2 in “Git-prune-script loses blobs referenced from an uncommitted cache.”
  1. Git-prune-script loses blobs referenced from an uncommitted cache.Junio C Hamano, May 3, 2005
  2. Linus TorvaldsMay 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.