git_prompt: Informative upstream with informative status

This makes $__fish_git_prompt_showupstream = "auto" mean "informative"
instead of "git" if $__fish_git_prompt_show_informative_status is set.
This commit is contained in:
Brian Gernhardt 2013-07-27 10:59:50 -04:00 committed by David Adam (zanchey)
parent 3af40efdb1
commit c4bc216815

View file

@ -162,6 +162,11 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
set -l legacy set -l legacy
set -l verbose set -l verbose
# Default to informative if show_informative_status is set
if test -n "$__fish_git_prompt_show_informative_status"
set informative 1
end
set -l svn_remote set -l svn_remote
# get some config options from git-config # get some config options from git-config
git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' ^/dev/null | tr '\0\n' '\n ' | while read -l key value git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' ^/dev/null | tr '\0\n' '\n ' | while read -l key value
@ -186,16 +191,20 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
end end
# parse configuration variables # parse configuration variables
# and clear informative default when needed
for option in $show_upstream for option in $show_upstream
switch $option switch $option
case git svn case git svn
set upstream $option set upstream $option
set -e informative
case verbose case verbose
set verbose 1 set verbose 1
set -e informative
case informative case informative
set informative 1 set informative 1
case legacy case legacy
set legacy 1 set legacy 1
set -e informative
end end
end end