diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-15 15:44:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-15 15:44:57 +1200 |
commit | dea08f530bd7cf0cff8808a20d1239053cc59749 (patch) | |
tree | 59197e6f74e2389c7e0667908b27ec78f80e48c8 /bash | |
parent | Fugitive updates (diff) | |
download | dotfiles-dea08f530bd7cf0cff8808a20d1239053cc59749.tar.gz dotfiles-dea08f530bd7cf0cff8808a20d1239053cc59749.zip |
Alert me if ahead of master
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bash/bashrc b/bash/bashrc index 2a135bbd..b05a1ea5 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -96,8 +96,11 @@ function prompt_git { git branch &>/dev/null || return 1 HEAD="$(git symbolic-ref HEAD 2>/dev/null)" BRANCH="${HEAD##*/}" + STATUS= [[ -n "$(git status 2>/dev/null | \ - grep -F 'working directory clean')" ]] || STATUS="!" + grep -F 'branch is ahead of')" ]] && STATUS="${STATUS}>" + [[ -n "$(git status 2>/dev/null | \ + grep -F 'working directory clean')" ]] || STATUS="${STATUS}!" echo -n "(git:${BRANCH:-unknown}${STATUS})" return $? } |