Skip to content

Instantly share code, notes, and snippets.

@kisom
Created July 8, 2012 00:45
Show Gist options
  • Save kisom/3068808 to your computer and use it in GitHub Desktop.
Save kisom/3068808 to your computer and use it in GitHub Desktop.
#!/bin/sh
# cd code && find . -type d -maxdepth 1 -exec repo-status '{}' \;
if [ ! -z "$1" ]; then
CWD="$(pwd)"
cd $1
fi
if [ -d .git ]; then
if git status -uno --porcelain | grep "^[[:space:]]M[[:space:]]" >/dev/null ; then
echo "$(basename $(pwd))"
fi
elif [ -d .hg ]; then
if [ ! -z "$(hg status -m -a -r -d)" ]; then
echo "$(basename $(pwd))"
fi
fi
if [ ! -z "$1" ]; then
cd $CWD
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment