Re: git gc / git repack not removing unused objects?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Feb 2010, Jon Nelson wrote:

> On Fri, Feb 5, 2010 at 2:51 PM, Nicolas Pitre <nico@xxxxxxxxxxx> wrote:
> > On Fri, 5 Feb 2010, Jon Nelson wrote:
> >
> >> [Using git 1.6.4.2]
> >>
> >> In one repo I have (136G objects directory, fully packed) I'm having
> >> some trouble.
> >> I've run git-gc --prune=now, git repack -Adf, and so on a half-dozen
> >> times and each time I do so it gets bigger, not smaller.
> >
> > Please tell us more.
> 
> I'll tell you whatever I can -- as soon as I know what it is you want.

I want to know what you did and what results you obtained to lead you to 
believe that 'git-gc --prune=now' makes your repository bigger.

> > You need to dig further down in history to find a commit that actually
> > references that blob/tree.  One easy method is to do:
> >
> >        git log --raw --all
> >
> > and within the pager ('less' by default) simply search for "b32c3d8".
> 
> OK. I'm piping "git log --raw --all" to a file this very moment. It'll
> take a while. However, one thing I did not mention is that there
> *should* be a 1:1 correlation between branches and commits. As in,
> every time I did a commit, the commit was on a new branch. 

Ouch.  Why?  I'm curious.

> I'll look into this, as I've fiddled with the repo a bunch of 
> different ways lately. I suspect the answer will be found in the logs.

If the blob you're looking for is not in that log, then it must be 
referenced by one of the reflog entries.  The reflog is a log of all the 
commits your branches, and the HEAD pointer, ever pointed at.  Those 
entries are kept for a certain period (3 months by default).  The HEAD 
reflog will keep a reference of all branches you might have visited, 
even deleted ones.  So another log:

	git log --raw -g HEAD

should ultimately give you the blob reference.


Nicolas

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]