Permalink
Browse files

add an indicator that says i need to push

  • Loading branch information...
1 parent 4f2c535 commit f6c3ca9ae4b3af09aff4c552f00b5f4a4d30de28 @bryanl bryanl committed Apr 2, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 06_git
View
8 06_git
@@ -14,14 +14,20 @@ if [[ -x `which git` ]]; then
git checkout "${branch}"
git rebase master
}
+ function git-need-to-push() {
+ if pushtime=$(git status | grep 'Your branch is ahead' 2> /dev/null); then
+ echo "↑ "
+ fi
+ }
function git-prompt() {
gstatus=$(git status 2> /dev/null)
branch=$(echo $gstatus | head -1 | sed 's/^# On branch //')
dirty=$(echo $gstatus | sed 's/^#.*$//' | tail -2 | grep 'nothing to commit (working directory clean)'; echo $?)
if [[ x$branch != x ]]; then
dirty_color=$fg[green]
+ push_status=$(git-need-to-push)
if [[ $dirty = 1 ]] { dirty_color=$fg[red] }
- [ x$branch != x ] && echo " %{$dirty_color%}$branch%{$reset_color%} "
+ [ x$branch != x ] && echo " %{$dirty_color%}$branch%{$reset_color%} $push_status"
fi
}
function git-scoreboard () {

0 comments on commit f6c3ca9

Please sign in to comment.