From: Oleg Broytman Date: Sun, 6 Nov 2016 13:03:21 +0000 (+0300) Subject: Run git gc/repack/fsck recursively (on submodules) X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f1cf0b7f2f8fccf7364be8dc0e998e9c64b55876;p=git-scripts.git Run git gc/repack/fsck recursively (on submodules) --- diff --git a/gc-and-repack b/gc-and-repack index 393ca28..80548d3 100755 --- a/gc-and-repack +++ b/gc-and-repack @@ -1,10 +1,5 @@ #! /bin/sh -prog_dir=`dirname "$0"` -for d in `"$prog_dir"/ls-not-packed` -do - echo "----- $d -----" && cd "$d" && - git gc --aggressive && - git repack -a -d -f --depth=20 --window=250 && - git fsck --strict || exit 1 -done +git gc --aggressive && +git repack -a -d -f --depth=20 --window=250 && +exec git fsck --strict diff --git a/gc-and-repack-recursive b/gc-and-repack-recursive new file mode 100755 index 0000000..8106725 --- /dev/null +++ b/gc-and-repack-recursive @@ -0,0 +1,6 @@ +#! /bin/sh + +prog_dir="`dirname \"$0\"`" && + +"$prog_dir"/gc-and-repack && \ +exec git submodule foreach "$prog_dir"/gc-and-repack diff --git a/gc-and-repack-repos b/gc-and-repack-repos new file mode 100755 index 0000000..2f6d731 --- /dev/null +++ b/gc-and-repack-repos @@ -0,0 +1,10 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +prog_dir="`pwd`" && + +for d in `"$prog_dir"/ls-not-packed` +do + echo "----- $d -----" && cd "$d" && + "$prog_dir"/gc-and-repack-recursive || exit 1 +done diff --git a/gc-not-packed b/gc-not-packed index c9f7be2..2f6073c 100755 --- a/gc-not-packed +++ b/gc-not-packed @@ -1,8 +1,4 @@ #! /bin/sh -prog_dir=`dirname "$0"` -for d in `"$prog_dir"/ls-not-packed` -do - echo "----- $d -----" && cd "$d" && - git gc --aggressive && git fsck --strict || exit 1 -done +git gc --aggressive && +exec git fsck --strict diff --git a/gc-not-packed-recursive b/gc-not-packed-recursive new file mode 100755 index 0000000..c921386 --- /dev/null +++ b/gc-not-packed-recursive @@ -0,0 +1,6 @@ +#! /bin/sh + +prog_dir="`dirname \"$0\"`" && + +"$prog_dir"/gc-not-packed && \ +exec git submodule foreach "$prog_dir"/gc-not-packed diff --git a/gc-not-packed-repos b/gc-not-packed-repos new file mode 100755 index 0000000..f7b7c78 --- /dev/null +++ b/gc-not-packed-repos @@ -0,0 +1,10 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +prog_dir="`pwd`" && + +for d in `"$prog_dir"/ls-not-packed` +do + echo "----- $d -----" && cd "$d" && + "$prog_dir"/gc-not-packed-recursive || exit 1 +done