From f1cf0b7f2f8fccf7364be8dc0e998e9c64b55876 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 6 Nov 2016 16:03:21 +0300 Subject: [PATCH] Run git gc/repack/fsck recursively (on submodules) --- gc-and-repack | 11 +++-------- gc-and-repack-recursive | 6 ++++++ gc-and-repack-repos | 10 ++++++++++ gc-not-packed | 8 ++------ gc-not-packed-recursive | 6 ++++++ gc-not-packed-repos | 10 ++++++++++ 6 files changed, 37 insertions(+), 14 deletions(-) create mode 100755 gc-and-repack-recursive create mode 100755 gc-and-repack-repos create mode 100755 gc-not-packed-recursive create mode 100755 gc-not-packed-repos 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 -- 2.39.5