git repack (was: Re: Mokomakefile error: fatal: Fetch failure: git://git.openmoko.org/git/kernel.git)

Cesar Eduardo Barros cesarb at cesarb.net
Sat Aug 9 14:20:21 CEST 2008


Joachim Steiger escreveu:
> should be fixed now.
> 
> i dunno exactly what the problem was, but i restarted git-daemon and gitweb.
> then i ran git-repack on the repos.
> seems fine again.
> also the repos got much smaller, which i hope is a good sign.
> 
> when nobody has anything bad to note about this i would like to add a
> weekly cron which does this:
> 
> http://blog.madism.org/index.php/2007/02/21/123-git-tricks
> 
> see also
> http://admin-trac.openmoko.org/trac/ticket/1492
> 

I would recommend "git gc" instead, which not only does a "git repack -a 
-d -l", but also cleans up some other stuff.

Another option would be running "git gc --auto" often; it does nothing 
until there are over 6700 loose objects, which it then packs on a new 
pack, and it condenses all packs into one (like "git repack -a -d -l") 
when there are over 50 packs (both values are configurable). Since it's 
much more lightweight (except when it decides to do a full repack), it 
can be run very often (and in fact some commands run it automatically).

And, as a comment in the blog post said, using "git count-objects" is 
better than "find objects | cut -d/ -f3 | wc -w" (but if you are using 
that, "git gc --auto" is usually better).

-- 
Cesar Eduardo Barros
cesarb at cesarb.net
cesar.barros at gmail.com




More information about the devel mailing list