Re: gc --aggressive
- From
Jeff King <peff@peff.net>
- Date
- Apr 17, 2012, 21:58 UTC
- Message-ID
- <20120417215801.GA10797@sigill.intra.peff.net>
- In-Reply-To
- <vpqbomqqdxo.fsf@bauges.imag.fr>
On Tue, Apr 17, 2012 at 10:52:03PM +0200, Matthieu Moy wrote:
Show 11 quoted lines
> Jay Soffian <jaysoffian@gmail.com> writes: > > > + 3. `git gc --aggressive`; this is often much slower than (2) because git > > + throws out all of the existing deltas and recomputes them from > > + scratch. It uses a higher window parameter meaning it will spend > > + more time computing, and it may end up with a smaller pack. However, > > + unless the repository is known to have initially been poorly packed, > > + this option is not needed and will just cause git to perform > > + extra work. > > I like your patch.
Me too. I guess it is not surprising since I wrote the initial draft. ;)
> Maybe you should elaborate on "unless the repository is known to have > initially been poorly packed". My understanding is that --aggressive was > implemented to be called after an import from another VCS that would > have computed very poor deltas, but I'm not sure about the details.
Yes, that's exactly it. fast-import will generate packs, but they are often not optimal. So if you have done a big import, you should definitely "git gc --aggressive" as the final step. I don't know how something like a remote-helper would work, where it is fast-importing little bits at a time. Probably a regular repack would be fine, since it will be considering deltas between objects in different packs anyway.
-Peff