]> git.phdru.name Git - git-scripts.git/commitdiff
Run git gc/repack/fsck recursively (on submodules)
authorOleg Broytman <phd@phdru.name>
Sun, 6 Nov 2016 13:03:21 +0000 (16:03 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 6 Nov 2016 13:03:21 +0000 (16:03 +0300)
gc-and-repack
gc-and-repack-recursive [new file with mode: 0755]
gc-and-repack-repos [new file with mode: 0755]
gc-not-packed
gc-not-packed-recursive [new file with mode: 0755]
gc-not-packed-repos [new file with mode: 0755]

index 393ca28bc0e4451799c700650ead2a6fe2d03134..80548d3329c8b2d3da398a18ea767a64421476e4 100755 (executable)
@@ -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 (executable)
index 0000000..8106725
--- /dev/null
@@ -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 (executable)
index 0000000..2f6d731
--- /dev/null
@@ -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
index c9f7be2537b008c7d6164abfde0a0535e5327866..2f6073c7477a7f9acf62bf5ef8ea70102153c2ec 100755 (executable)
@@ -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 (executable)
index 0000000..c921386
--- /dev/null
@@ -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 (executable)
index 0000000..f7b7c78
--- /dev/null
@@ -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