]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(locate-all): Exclude submodules
authorOleg Broytman <phd@phdru.name>
Wed, 18 Dec 2019 01:53:31 +0000 (04:53 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 18 Dec 2019 01:53:31 +0000 (04:53 +0300)
Check submodules by files `.git`.

locate-all

index afaa3e757cfb9ce77517230c97faa4e67c157768..841721ea07bbffd902f1278e6c0ab16d372cd2dc 100755 (executable)
@@ -1,4 +1,13 @@
 #! /bin/sh
-locate -b \*.git | sed 's!/\.git$!!' |
+locate -b \*.git |
    grep -v "/archive/SQLObject/\|/archive/cheetah3/\|/third-party/\|$HOME/tmp/" |
+   while read path; do
+      if [ -d "$path" ]; then # skip files `.git` - they're submodules
+         if [ "`basename \"$path\"`" = .git ]; then
+            dirname "$path"
+         else
+            echo "$path"
+         fi
+      fi
+   done |
    LC_ALL=C sort | uniq > locate-all.list