]> gitweb.fluxo.info Git - utils-git.git/commitdiff
Adds git-submodule-move-all-git-dirs
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 7 Nov 2017 18:38:30 +0000 (16:38 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 7 Nov 2017 18:38:30 +0000 (16:38 -0200)
git-submodule-move-all-git-dirs [new file with mode: 0755]
git-submodule-move-git-dir

diff --git a/git-submodule-move-all-git-dirs b/git-submodule-move-all-git-dirs
new file mode 100755 (executable)
index 0000000..41a7352
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Call git-submodule-move-git-dir for each repository in a tree
+#
+
+# Parameters
+BASENAME="`basename $0`"
+
+# Checks
+if [ ! -e ".git" ]; then
+  echo "please run this command in the top-level repository folder"
+  exit 1
+fi
+
+# If we invert find results so we begin conversion at the toplevel folders
+#find -type f -name .git | tac | while read repo; do
+find -type f -name .git | while read repo; do
+  folder="`dirname $repo`"
+  git-submodule-move-git-dir $folder
+done
index b30f247c1257ecc47fe61ff84ef49283119b8521..8c28e66eb381afd52fb317f390885734815ed00a 100755 (executable)
@@ -27,7 +27,7 @@ elif [ ! -d "$MODULE" ]; then
 elif [ -d "$MODULE/.git" ]; then
   echo "module $MODULE already converted"
   exit 1
-elif [ ! -d ".git" ]; then
+elif [ ! -e ".git" ]; then
   echo "please run this command in the top-level repository folder"
   exit 1
 fi