From 82cab1f60d03f9efd686cd13422f5a493ff0f46a Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues de Almeida Date: Fri, 4 Apr 2014 20:46:10 -0300 Subject: [PATCH] Showing the difference of commits on upstream --- themes/integral/fish_prompt.fish | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/integral/fish_prompt.fish b/themes/integral/fish_prompt.fish index 41b1895..eaf39b4 100644 --- a/themes/integral/fish_prompt.fish +++ b/themes/integral/fish_prompt.fish @@ -4,18 +4,19 @@ function _git_branch_name end function _git_vs_upstream - set -l count (command git rev-list --count --left-right "origin/$argv"...HEAD ^/dev/null) + set count (command git rev-list --count --left-right "origin/$argv"...HEAD ^/dev/null) + switch $count case "" # no upstream echo '' case "0?0" # equal to upstream echo '' case "0??" # ahead of upstream - echo u+ + echo 'u+'(echo $count | cut -f2) case "??0" # behind upstream - echo u- + echo 'u-'(echo $count | cut -f1) case '???' # diverged from upstream - echo u+- + echo 'u+'(echo $count | cut -f2)'-'(echo $count | cut -f1) end end