projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'dev' of feistymeow.org:feisty_meow into dev
[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 8de72543f7ad3c969e597499ffed720e0a9e50bf..c1a22ef0b5c45d41cfcddd3764aa61ed88a97d5d 100644
(file)
--- a/
scripts/rev_control/compact_git.sh
+++ b/
scripts/rev_control/compact_git.sh
@@
-2,16
+2,28
@@
# compresses the git archive in the folder specified.
# compresses the git archive in the folder specified.
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+##############
+
prune_dir="$1"
if [ -z "$prune_dir" ]; then
prune_dir="$(pwd)"
fi
prune_dir="$1"
if [ -z "$prune_dir" ]; then
prune_dir="$(pwd)"
fi
-pushd "$prune_dir"
+pushd "$prune_dir" &>/dev/null
+test_or_die "changing to directory: $prune_dir"
+
echo "cleaning git repo in directory $(pwd)"
echo "cleaning git repo in directory $(pwd)"
+
git fsck --full
test_or_die "git fsck"
git fsck --full
test_or_die "git fsck"
+
git gc --prune=today --aggressive
test_or_die "git gc"
git gc --prune=today --aggressive
test_or_die "git gc"
+
git repack
test_or_die "git repack"
git repack
test_or_die "git repack"
-popd
+
+popd &>/dev/null
+