mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-21 21:32:01 +08:00
Showing the difference of commits on upstream
This commit is contained in:
parent
b9031f3ed1
commit
82cab1f60d
|
@ -4,18 +4,19 @@ function _git_branch_name
|
||||||
end
|
end
|
||||||
|
|
||||||
function _git_vs_upstream
|
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
|
switch $count
|
||||||
case "" # no upstream
|
case "" # no upstream
|
||||||
echo ''
|
echo ''
|
||||||
case "0?0" # equal to upstream
|
case "0?0" # equal to upstream
|
||||||
echo ''
|
echo ''
|
||||||
case "0??" # ahead of upstream
|
case "0??" # ahead of upstream
|
||||||
echo u+
|
echo 'u+'(echo $count | cut -f2)
|
||||||
case "??0" # behind upstream
|
case "??0" # behind upstream
|
||||||
echo u-
|
echo 'u-'(echo $count | cut -f1)
|
||||||
case '???' # diverged from upstream
|
case '???' # diverged from upstream
|
||||||
echo u+-
|
echo 'u+'(echo $count | cut -f2)'-'(echo $count | cut -f1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user