From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: gc --aggressive Date: Tue, 17 Apr 2012 14:58:01 -0700 Message-ID: <20120417215801.GA10797@sigill.intra.peff.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Jay Soffian , git , Junio C Hamano , Shawn Pearce To: Matthieu Moy X-From: git-owner@vger.kernel.org Tue Apr 17 23:58:12 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SKGPb-0003w3-9m for gcvg-git-2@plane.gmane.org; Tue, 17 Apr 2012 23:58:11 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751624Ab2DQV6G (ORCPT ); Tue, 17 Apr 2012 17:58:06 -0400 Received: from 99-108-226-0.lightspeed.iplsin.sbcglobal.net ([99.108.226.0]:37378 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795Ab2DQV6F (ORCPT ); Tue, 17 Apr 2012 17:58:05 -0400 Received: (qmail 8832 invoked by uid 107); 17 Apr 2012 21:58:13 -0000 Received: from c-67-169-43-61.hsd1.ca.comcast.net (HELO sigill.intra.peff.net) (67.169.43.61) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Tue, 17 Apr 2012 17:58:13 -0400 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Tue, 17 Apr 2012 14:58:01 -0700 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Tue, Apr 17, 2012 at 10:52:03PM +0200, Matthieu Moy wrote: > Jay Soffian 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