X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Frev_control%2Fcompact_git.sh;h=8de72543f7ad3c969e597499ffed720e0a9e50bf;hb=170a8e062d9283e65716e7aa55930ade13a66f7a;hp=88efcdaae62007f0dfbf2f5188699c874cf0adaa;hpb=7b89ef73b80a77a4ebf1109c47a381249bae6bdc;p=feisty_meow.git diff --git a/scripts/rev_control/compact_git.sh b/scripts/rev_control/compact_git.sh index 88efcdaa..8de72543 100644 --- a/scripts/rev_control/compact_git.sh +++ b/scripts/rev_control/compact_git.sh @@ -1,15 +1,17 @@ #!/bin/bash +# compresses the git archive in the folder specified. + prune_dir="$1" if [ -z "$prune_dir" ]; then prune_dir="$(pwd)" fi pushd "$prune_dir" -echo cleaning git in directory $(pwd) +echo "cleaning git repo in directory $(pwd)" git fsck --full -check_if_failed "git fsck" +test_or_die "git fsck" git gc --prune=today --aggressive -check_if_failed "git gc" +test_or_die "git gc" git repack -check_if_failed "git repack" +test_or_die "git repack" popd