mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
show arrow when exist local commits to push
This commit is contained in:
parent
4dfc1a087c
commit
e7b4dac58d
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
# inspirated in { kolo alanpeabody microtech }.zsh-theme
|
# inspirated in { kolo alanpeabody nanotech }.zsh-theme
|
||||||
|
# inspirated in https://github.com/lvv/git-prompt
|
||||||
autoload -U colors && colors
|
autoload -U colors && colors
|
||||||
|
|
||||||
autoload -Uz vcs_info
|
autoload -Uz vcs_info
|
||||||
|
|
@ -43,12 +44,12 @@ function git_remotes() {
|
||||||
(git fetch $remote >& /dev/null &)
|
(git fetch $remote >& /dev/null &)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
pushed=$(git log --oneline origin/master..HEAD | wc -l )
|
||||||
|
[ "$pushed" -gt "0" ] && remotes+="↑:"$pushed
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo $remotes
|
echo $remotes
|
||||||
}
|
}
|
||||||
# TODO if commits to push show this number
|
|
||||||
# TODO show arrow when push is necessary
|
|
||||||
local remotes='%B%F{green}$(git_remotes)%{$reset_color%}'
|
local remotes='%B%F{green}$(git_remotes)%{$reset_color%}'
|
||||||
|
|
||||||
precmd () {
|
precmd () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue