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

Re: git-prune-script eats data

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 23, 2005, 02:04 UTC
Message-ID
<Pine.LNX.4.58.0506221857410.11175@ppc970.osdl.org>
In-Reply-To
<42B8B629.1040208@pobox.com>
On Tue, 21 Jun 2005, Jeff Garzik wrote:
Show 7 quoted lines
> 
> $ git-prune-script
> 
> $ git-fsck-cache
> error: cannot map sha1 file c39ae07f393806ccf406ef966e9a15afc43cc36a
> bad object in tag 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c
> bad sha1 entry '5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c'

It's exactly the same thing that Jens had. You have a tag object for the v2.6.11-tree thing, but you don't have the reference to the tag.

And now I realize what the problem is. It's _not_ that "git prune" has removed too much, like the obvious implication would be: it's that "git prune" has not removed _enough_.

"git prune" normally never removes tag-objects, whether reachable or not. That's because git-fsck-cache was explicitly ignoring them, which was because early on, the way you found tags was you did

	git-fsck-cache --tags
and then you created refs to them manually. 

But now that special case causes problems (and is no longer needed anyway), because it means that "git prune" will not remove unreachable tags, but it _will_ remove everything that an unreachable tag points to (because that is also unreachable).

So the trivial fix is to just remove the lines from fsck-cache.c that say
	/* Don't bother with tag reachability. */
	if (obj->type == tag_type)
		continue;
and that will fix it for you.
Will do.
		Linus
Previous: Jeff GarzikNext: Jeff Garzik
Message 2 of 3 in “git-prune-script eats data”
  1. Jeff GarzikJun 22, 2005
  2. Linus TorvaldsJun 23, 2005
  3. Jeff GarzikJun 23, 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.