Skip to content

Instantly share code, notes, and snippets.

@clsn
Created May 23, 2011 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clsn/987534 to your computer and use it in GitHub Desktop.
Save clsn/987534 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $# -gt 0 ]
then DIR="$1"
else DIR="."
fi
if [ -d "$DIR/.hg" ]
then echo hg status "$DIR"
hg status "$DIR"
elif [ -d "$DIR/.svn" ]
then echo "svn status $DIR"
svn status "$DIR"
elif [ -d "$DIR/.git" ]
then echo "git --git-dir=\"$DIR/.git\" --work-tree=\"$DIR\" status"
git --git-dir="$DIR/.git" --work-tree="$DIR" status
elif [ -d "$DIR/.bzr" ]
then echo "bzr status $DIR"
bzr status "$DIR"
else
echo "Unknown VCS (if any)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment