Permalink
Browse files

Merge branch 'git_status' of https://github.com/carlosgaldino/rvm int…

…o carlosgaldino-git_status
  • Loading branch information...
2 parents 89e301c + 866f1d6 commit 682739b1cebea7de4a52177dda326dea79f6fa26 @wayneeseguin wayneeseguin committed Apr 7, 2011
Showing with 20 additions and 1 deletion.
  1. +20 −1 contrib/ps1_functions
View
@@ -70,10 +70,29 @@ ps1_git()
esac
if [[ $color -gt 0 ]] ; then
- printf "\[\033[${attr}${color}m\](git:${branch}:$sha1)\[\033[0m\] "
+ printf "\[\033[${attr}${color}m\](git:${branch}$(parse_git_status):$sha1)\[\033[0m\] "
fi
}
+parse_git_status()
+{
+ printf "$(parse_git_added)$(parse_git_modified)$(parse_git_deleted)"
+}
+
+parse_git_deleted()
+{
+ [[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-"
+}
+
+parse_git_added()
+{
+ [[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+'
+}
+
+parse_git_modified()
+{
+ [[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*"
+}
ps1_rvm()
{

0 comments on commit 682739b

Please sign in to comment.