aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2012-06-15 15:44:57 +1200
committerTom Ryder <tom@sanctum.geek.nz>2012-06-15 15:44:57 +1200
commitdea08f530bd7cf0cff8808a20d1239053cc59749 (patch)
tree59197e6f74e2389c7e0667908b27ec78f80e48c8 /bash
parentFugitive updates (diff)
downloaddotfiles-dea08f530bd7cf0cff8808a20d1239053cc59749.tar.gz
dotfiles-dea08f530bd7cf0cff8808a20d1239053cc59749.zip
Alert me if ahead of master
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc5
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 $?
}