diff options
author | Brian Gernhardt <brian@gernhardtsoftware.com> | 2013-07-27 11:04:54 -0400 |
---|---|---|
committer | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2013-07-30 11:31:24 +0800 |
commit | 1964b04ea9d3bcddd5cfed2b2abe5a2adb69856b (patch) | |
tree | cbcfc4eeba109e88c7b90cdc3c9795e81eb4cbaa /share/functions/__fish_git_prompt.fish | |
parent | c4bc216815db36fbfbccd1adda255c40314c8ebb (diff) |
git_prompt: Show upstream with informative status
This makes $__fish_git_prompt_show_informative_status imply
$__fish_git_prompt_showupstream = "informative", while adding a none
option for showupstream to disable it if desired.
Diffstat (limited to 'share/functions/__fish_git_prompt.fish')
-rw-r--r-- | share/functions/__fish_git_prompt.fish | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 485f5d1d..a36dab29 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -56,6 +56,7 @@ # of git-rev-list # git always compare HEAD to @{upstream} # svn always compare HEAD to your SVN upstream +# none disables (fish only, useful with show_informative_status) # # By default, __fish_git_prompt will compare HEAD to your SVN upstream if it # can find one, or @{upstream} otherwise. Once you have set @@ -84,12 +85,14 @@ # An "informative git prompt" mode similar to the scripts for bash and zsh # can be activated by setting __fish_git_prompt_show_informative_status # This works more like the "informative git prompt" scripts for bash and zsh, -# giving prompts like (master|+1#2*3%4) where master is the current branch -# and you have 1 staged, 2 unmerged, 3 dirty, and 4 untracked files. If you -# have no changes, it displays (master|.). The characters and colors can be -# customized as below, with the following names: +# giving prompts like (master >1<2|+3#4*5%6) where master is the current branch, +# you have 1 commit your upstream doesn't and it has 2 you don't, and you have +# 3 staged, 4 unmerged, 5 dirty, and 6 untracked files. If you have no +# changes, it displays (master|.). The characters and colors can be customized +# as below, with the following names: # -# dirtystate, invalidstate, stagedstate, untrackedfiles, cleanstate +# upstream_prefix, upstream_ahead, upstream_behind, dirtystate, +# invalidstate, stagedstate, untrackedfiles, cleanstate # # The color for each component of the prompt can specified using # __fish_git_prompt_color_<name>, where <name> is one of the following and the @@ -205,6 +208,8 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi case legacy set legacy 1 set -e informative + case none + return end end @@ -363,7 +368,7 @@ function __fish_git_prompt --description "Prompt function for Git" end end - if test -n "$__fish_git_prompt_showupstream" + if test -n "$__fish_git_prompt_showupstream" -o "$__fish_git_prompt_show_informative_status" set p (__fish_git_prompt_show_upstream) end end |