threads / bug / 37576

Apparent bug in git-gc

Subject: Apparent bug in git-gc

## tl;dr

3 messages between Sep 15, 2014 and Sep 16, 2014.

replies: 2people: 2as markdown or json

Dale R. Worley· Sep 15, 2014, 23:34 UTC · lore
I have an unpleasant bug in git-gc:

Git version: 1.8.3.1 Running on: Fedora 19 Gnu/Linux

I have an 11 GB repository. It passes git-fsck (though with a number of dangling objects). But when I run git-gc on it, the file refs/heads/master disappears. Since HEAD points to refs/heads/master, this makes the repository unusable.

What should I do next?
Dale
Jeff King· Sep 16, 2014, 00:30 UTC · re: Dale R. Worley · lore

Re: Apparent bug in git-gc

On Mon, Sep 15, 2014 at 07:34:03PM -0400, Dale R. Worley wrote:
> I have an 11 GB repository.  It passes git-fsck (though with a number
> of dangling objects).  But when I run git-gc on it, the file
> refs/heads/master disappears.

That's the expected behavior. Gc runs "git pack-refs", which puts an entry into packed-refs and prunes the loose ref.

> Since HEAD points to refs/heads/master, this makes the repository
> unusable.

Unusable how? Does `git rev-parse refs/heads/master` still produce a sha1? Does `git rev-parse HEAD`? If not, then that is definitely a bug.

-Peff
Dale R. Worley· Sep 16, 2014, 18:09 UTC · re: Jeff King · lore

Re: Apparent bug in git-gc

Show 8 quoted lines
> From: Jeff King <peff@peff.net>
> 
> > I have an 11 GB repository.  It passes git-fsck (though with a number
> > of dangling objects).  But when I run git-gc on it, the file
> > refs/heads/master disappears.
> 
> That's the expected behavior. Gc runs "git pack-refs", which puts an
> entry into packed-refs and prunes the loose ref.
Arrrgh, damn!  I knew that but I forgot it.  Sorry about the trouble.
(At least I don't have to worry about fixing it now.)
Dale

← back to recent threads