From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Shawn O. Pearce" Subject: Re: Invoke "git gc --auto" from commit, merge, am and rebase. Date: Wed, 5 Sep 2007 22:39:34 -0400 Message-ID: <20070906023934.GI18160@spearce.org> References: <20070905074206.GA31750@artemis.corp> <87odgh0zn6.fsf@hades.wkstn.nix> <46DEF1FA.4050500@midwinter.com> <877in50y7p.fsf@hades.wkstn.nix> <7vr6lcj2zi.fsf@gitster.siamese.dyndns.org> <7vwsv4hjfi.fsf@gitster.siamese.dyndns.org> <7vmyw0hixs.fsf_-_@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Nicolas Pitre , Nix , Steven Grimm , Linus Torvalds , Git Mailing List To: Junio C Hamano X-From: git-owner@vger.kernel.org Thu Sep 06 04:39:59 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1IT7Hg-0001NE-KB for gcvg-git@gmane.org; Thu, 06 Sep 2007 04:39:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757419AbXIFCjw (ORCPT ); Wed, 5 Sep 2007 22:39:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757438AbXIFCjw (ORCPT ); Wed, 5 Sep 2007 22:39:52 -0400 Received: from corvette.plexpod.net ([64.38.20.226]:36081 "EHLO corvette.plexpod.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757351AbXIFCjv (ORCPT ); Wed, 5 Sep 2007 22:39:51 -0400 Received: from [74.70.48.173] (helo=asimov.home.spearce.org) by corvette.plexpod.net with esmtpa (Exim 4.66) (envelope-from ) id 1IT7HB-0006Pa-6I; Wed, 05 Sep 2007 22:39:25 -0400 Received: by asimov.home.spearce.org (Postfix, from userid 1000) id 4CAAF20FBAE; Wed, 5 Sep 2007 22:39:35 -0400 (EDT) Content-Disposition: inline In-Reply-To: <7vmyw0hixs.fsf_-_@gitster.siamese.dyndns.org> User-Agent: Mutt/1.5.11 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - corvette.plexpod.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - spearce.org Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano wrote: > The point of auto gc is to pack new objects created in loose > format, so a good rule of thumb is where we do update-ref after > creating a new commit. ... > git-am.sh | 2 ++ > git-commit.sh | 1 + > git-merge.sh | 1 + > git-rebase--interactive.sh | 2 ++ > 4 files changed, 6 insertions(+), 0 deletions(-) ... > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > index abc2b1c..8258b7a 100755 > --- a/git-rebase--interactive.sh > +++ b/git-rebase--interactive.sh > @@ -307,6 +307,8 @@ do_next () { > rm -rf "$DOTEST" && > warn "Successfully rebased and updated $HEADNAME." > > + git gc --auto > + > exit > } Why bother with git-rebase--interactive.sh? It calls two tools, git-cherry-pick (which calls git-commit) and git-commit to do its per-commit dirty work. So on every step of `git rebase -i` we are now running `git gc --auto`. No need to also run it at the end. Note this is also true of `git rebase -m` as that uses the wonderful feature of `git commit -C $oldid` per commit to make the new commit. -- Shawn.