]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Invoke "git gc --auto" from commit, merge, am and rebase.
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Sep 2007 21:59:59 +0000 (14:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Sep 2007 07:08:56 +0000 (00:08 -0700)
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.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh
git-commit.sh
git-merge.sh
git-rebase--interactive.sh

index 6809aa07f60165855ebc0192750e85569f9685ff..4db4701c9ec7a5f5fa85c3a6d0576903b5d2741a 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -466,6 +466,8 @@ do
                "$GIT_DIR"/hooks/post-applypatch
        fi
 
+       git gc --auto
+
        go_next
 done
 
index 1d04f1ff31cf99a6dec1d52866668007ab2dae72..d22d35eadc7c2c3dcc4825ddbf034e81d376c2ec 100755 (executable)
@@ -652,6 +652,7 @@ git rerere
 
 if test "$ret" = 0
 then
+       git gc --auto
        if test -x "$GIT_DIR"/hooks/post-commit
        then
                "$GIT_DIR"/hooks/post-commit
index 3a01db0d751e272541efd0f27177a9ca5cb63bbe..697bec24fa2da16fb1fa7f618a700c0110b5e5fa 100755 (executable)
@@ -82,6 +82,7 @@ finish () {
                        ;;
                *)
                        git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
+                       git gc --auto
                        ;;
                esac
                ;;
index abc2b1c3e06bf1904ed92a691e917e8718e9e299..8258b7adf97d2bc4378d3b92f66e83b383669414 100755 (executable)
@@ -307,6 +307,8 @@ do_next () {
        rm -rf "$DOTEST" &&
        warn "Successfully rebased and updated $HEADNAME."
 
+       git gc --auto
+
        exit
 }