From: Oleg Broytman Date: Sun, 3 Aug 2014 23:37:46 +0000 (+0400) Subject: Do something on all located git repositories X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=9d1f4913c3228f846cfe1eb81e42dc1a2902b29c;p=git-scripts.git Do something on all located git repositories --- diff --git a/do-all b/do-all new file mode 100755 index 0000000..2a8e19b --- /dev/null +++ b/do-all @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +prog_dir="`dirname \"$0\"`" && + +while true; do + read d || exit 0 + if ! test -d "$d"; then continue; fi + test -d "$d"/.git && g="$d"/.git || g="$d" + b="`basename \"$d\" .git`" + eval "$@" +done < "$prog_dir"/locate-all.list diff --git a/gc-not-packed b/gc-not-packed new file mode 100755 index 0000000..c9f7be2 --- /dev/null +++ b/gc-not-packed @@ -0,0 +1,8 @@ +#! /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 diff --git a/ls-not-packed b/ls-not-packed new file mode 100755 index 0000000..d2bb878 --- /dev/null +++ b/ls-not-packed @@ -0,0 +1,4 @@ +#! /bin/sh + +exec "`dirname \"$0\"`"/do-all \ + 'test "`ls -1 \"$g\"/objects 2>/dev/null | wc -l`" -gt 2 && echo "$d"'