]> git.phdru.name Git - git-scripts.git/commitdiff
Add scripts to run fsck of all repositories
authorOleg Broytman <phd@phdru.name>
Fri, 18 Jan 2019 03:12:29 +0000 (06:12 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 18 Jan 2019 03:12:29 +0000 (06:12 +0300)
fsck [new file with mode: 0755]
fsck-recursive [new file with mode: 0755]
fsck-repos [new file with mode: 0755]

diff --git a/fsck b/fsck
new file mode 100755 (executable)
index 0000000..14f2ac5
--- /dev/null
+++ b/fsck
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec git fsck --strict
diff --git a/fsck-recursive b/fsck-recursive
new file mode 100755 (executable)
index 0000000..3e47bd2
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+prog_dir="`dirname \"$0\"`" &&
+"$prog_dir"/fsck &&
+
+if [ -f .gitmodules ]; then
+   exec git submodule foreach "$prog_dir"/fsck
+fi
diff --git a/fsck-repos b/fsck-repos
new file mode 100755 (executable)
index 0000000..a31c8bb
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+cd "`dirname \"$0\"`" &&
+prog_dir="`pwd`" &&
+export prog_dir
+
+exec "$prog_dir"/do-all \
+   'echo "----- $d -----" && cd "$d" &&' \
+   '"$prog_dir"/fsck-recursive || exit 1'