# Apparent bug in git-gc

3 messages from 2014-09-15 to 2014-09-16. Participants: Dale R. Worley, Jeff King.
Thread: https://gitlist.dev/t/37576

## Dale R. Worley, 2014-09-15 23:34

Subject: Apparent bug in git-gc
Message-ID: <201409152334.s8FNY33M032615@hobgoblin.ariadne.com>
URL: https://gitlist.dev/e/201409152334.s8FNY33M032615%40hobgoblin.ariadne.com

```
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, 2014-09-16 00:30

Subject: Re: Apparent bug in git-gc
Message-ID: <20140916003046.GE5019@peff.net>
URL: https://gitlist.dev/e/20140916003046.GE5019%40peff.net
In-Reply-To: <201409152334.s8FNY33M032615@hobgoblin.ariadne.com>

```
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, 2014-09-16 18:09

Subject: Re: Apparent bug in git-gc
Message-ID: <201409161809.s8GI9Dd4002425@hobgoblin.ariadne.com>
URL: https://gitlist.dev/e/201409161809.s8GI9Dd4002425%40hobgoblin.ariadne.com
In-Reply-To: <20140916003046.GE5019@peff.net>

```
> 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

```
