projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added careful error checking to rev control
[feisty_meow.git]
/
scripts
/
rev_control
/
compact_git.sh
diff --git
a/scripts/rev_control/compact_git.sh
b/scripts/rev_control/compact_git.sh
index 88efcdaae62007f0dfbf2f5188699c874cf0adaa..8de72543f7ad3c969e597499ffed720e0a9e50bf 100644
(file)
--- a/
scripts/rev_control/compact_git.sh
+++ b/
scripts/rev_control/compact_git.sh
@@
-1,15
+1,17
@@
#!/bin/bash
#!/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"
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
git fsck --full
-
check_if_failed
"git fsck"
+
test_or_die
"git fsck"
git gc --prune=today --aggressive
git gc --prune=today --aggressive
-
check_if_failed
"git gc"
+
test_or_die
"git gc"
git repack
git repack
-
check_if_failed
"git repack"
+
test_or_die
"git repack"
popd
popd