Browse Source

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>
maint
Junio C Hamano 18 years ago
parent
commit
d4bb43ee27
  1. 2
      git-am.sh
  2. 1
      git-commit.sh
  3. 1
      git-merge.sh
  4. 2
      git-rebase--interactive.sh

2
git-am.sh

@ -466,6 +466,8 @@ do @@ -466,6 +466,8 @@ do
"$GIT_DIR"/hooks/post-applypatch
fi

git gc --auto

go_next
done


1
git-commit.sh

@ -652,6 +652,7 @@ git rerere @@ -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

1
git-merge.sh

@ -82,6 +82,7 @@ finish () { @@ -82,6 +82,7 @@ finish () {
;;
*)
git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
git gc --auto
;;
esac
;;

2
git-rebase--interactive.sh

@ -307,6 +307,8 @@ do_next () { @@ -307,6 +307,8 @@ do_next () {
rm -rf "$DOTEST" &&
warn "Successfully rebased and updated $HEADNAME."

git gc --auto

exit
}


Loading…
Cancel
Save