Created
June 14, 2011 17:14
-
-
Save scottstanfield/1025376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# execute like: | |
# % git status |& git-prompt.awk | |
# (Inspiration from http://niczsoft.com/2010/05/my-git-prompt/) | |
BEGIN { branch = ""; prefix=""; suffix="" } | |
/# On branch/ { branch = $4; } | |
/untracked files present/ { prefix = prefix "*"; } | |
/Changed but not updated/ { prefix = prefix "^"; } | |
/Changes to be committed/ { prefix = prefix "~"; } | |
/nothing to commit/ {} | |
/branch is ahead/ { suffix = suffix "+"} | |
END { if (branch != "") { print " (" prefix branch suffix ")"} } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment