]> Kevux Git Server - rit/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 6809aa0..4db4701 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 1d04f1f..d22d35e 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 3a01db0..697bec2 100755 (executable)
@@ -82,6 +82,7 @@ finish () {
                        ;;
                *)
                        git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
+                       git gc --auto
                        ;;
                esac
                ;;
index abc2b1c..8258b7a 100755 (executable)
@@ -307,6 +307,8 @@ do_next () {
        rm -rf "$DOTEST" &&
        warn "Successfully rebased and updated $HEADNAME."
 
+       git gc --auto
+
        exit
 }