]> git.phdru.name Git - git-scripts.git/blobdiff - locate-all
Feat(submodules/remove): Add option `-c`
[git-scripts.git] / locate-all
index a7837d217f2496ca187a820b9ff3208afe13f6a4..f83a8827e6caec8c5ef889893ccacecf69b6bc4e 100755 (executable)
@@ -1,3 +1,13 @@
 #! /bin/sh
-(locate -b \\.git && locate -b *.git) | sort | uniq |
-   sed 's!/\.git$!!' >locate-all.list
+locate -b \*.git |
+   grep -v "/archive/SQLObject/\|/archive/cheetah3/\|$HOME/tmp/\|/third-party/" |
+   while read path; do
+      if [ -d "$path" ]; then # skip files `.git` - they're submodules
+         if [ "`basename \"$path\"`" = .git ]; then
+            dirname "$path" # translate `project/.git/` to just `project/`
+         else
+            echo "$path" # bare repo `project.git/`
+         fi
+      fi
+   done |
+LC_ALL=C sort -u > locate-all.list