X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=locate-all;h=f83a8827e6caec8c5ef889893ccacecf69b6bc4e;hp=afaa3e757cfb9ce77517230c97faa4e67c157768;hb=HEAD;hpb=977046c556b88b04dd6246dbf6979ad1271308ee diff --git a/locate-all b/locate-all index afaa3e7..f83a882 100755 --- a/locate-all +++ b/locate-all @@ -1,4 +1,13 @@ #! /bin/sh -locate -b \*.git | sed 's!/\.git$!!' | - grep -v "/archive/SQLObject/\|/archive/cheetah3/\|/third-party/\|$HOME/tmp/" | - LC_ALL=C sort | uniq > 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