unixorn/git-extra-commands

View on GitHub
bin/git-find-dirty

Summary

Maintainability
Test Coverage
#!/usr/bin/env bash
#
# Original source: https://github.com/matthewmccullough/scripts/blob/master/git-finddirty

IFS=$'\n'

for gitprojpath in $(find . -type d -name .git | sort | sed "s/\/\.git//"); do
  pushd . > /dev/null
  cd "$gitprojpath" || continue
  isdirty=$(git status -s | grep "^.*")
  if [ -n "$isdirty" ]; then
    echo "DIRTY:" "$gitprojpath"
  fi
  popd > /dev/null
done