Skip to content

Commit

Permalink
Invoke "git gc --auto" from commit, merge, am and rebase.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Sep 6, 2007
1 parent 2c3c439 commit d4bb43e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ do
"$GIT_DIR"/hooks/post-applypatch
fi

git gc --auto

go_next
done

Expand Down
1 change: 1 addition & 0 deletions git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ finish () {
;;
*)
git update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
git gc --auto
;;
esac
;;
Expand Down
2 changes: 2 additions & 0 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ do_next () {
rm -rf "$DOTEST" &&
warn "Successfully rebased and updated $HEADNAME."

git gc --auto

exit
}

Expand Down

0 comments on commit d4bb43e

Please sign in to comment.