From a208df009955b4ee74933cf74f76901214e8ba09 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 6 Feb 2021 13:13:18 +0000 Subject: [PATCH] zsh/prompt: show ahead/behing @{push} counters --- zsh/lib/prompt.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zsh/lib/prompt.zsh b/zsh/lib/prompt.zsh index 92b63a0..5b22231 100644 --- a/zsh/lib/prompt.zsh +++ b/zsh/lib/prompt.zsh @@ -78,6 +78,13 @@ git_prompt_status() { (( behind > 0 )) && upstream_str+="%{$fg[blue]%} <$behind" git_status+="$upstream_str" + # Format push + push_ab=( $(git rev-list --left-right --count @...@{push} 2>/dev/null) ) + if (( $? == 0 )); then + (( push_ab[1] > 0 )) && git_status+="%{$fg_bold[blue]%} ⮝$push_ab[1]" + (( push_ab[2] > 0 )) && git_status+="%{$fg_bold[blue]%} ⮟$push_ab[2]" + fi + # Format stashed stashed=$(git stash list | wc -l) if (( stashed > 0 )) then -- 2.48.1