Invoke "git gc --auto" from commit, merge, am and rebase.
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>
Junio C Hamano committed
Sep 5, 2007 at 14:59 UTC
d4bb43ee273528064192848165f93f8fc3512be1
4 files changed
+6
git-am.sh
+2
@@ -466,6 +466,8 @@ do
466
"$GIT_DIR"/hooks/post-applypatch
467
fi
468
469
+ git gc --auto
470
+
471
go_next
472
done
473
git-commit.sh
+1
@@ -652,6 +652,7 @@ git rerere
652
653
if test "$ret" = 0
654
then
655
+ git gc --auto
656
if test -x "$GIT_DIR"/hooks/post-commit
657
then
658
"$GIT_DIR"/hooks/post-commit
git-merge.sh
+1
@@ -82,6 +82,7 @@ finish () {
82
;;
83
*)
84
git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
85
+ git gc --auto
86
;;
87
esac
88
;;
git-rebase--interactive.sh
+2
@@ -307,6 +307,8 @@ do_next () {
307
rm -rf "$DOTEST" &&
308
warn "Successfully rebased and updated $HEADNAME."
309
310
+ git gc --auto
311
+
312
exit
313
}
314