about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-09-21 12:42:36 +0000
committerClint Adams <clint@users.sourceforge.net>2008-09-21 12:42:36 +0000
commit1870a858eadc45066f0bd928302dbc66ccc4193e (patch)
tree007acc0ff0cbffcbb447ac3a3390a2a45c08bbdb /Functions
parent90c33894c452b28076a7c22561692a014cc31f81 (diff)
downloadzsh-1870a858eadc45066f0bd928302dbc66ccc4193e.tar.gz
zsh-1870a858eadc45066f0bd928302dbc66ccc4193e.tar.xz
zsh-1870a858eadc45066f0bd928302dbc66ccc4193e.zip
25697: drop git code and switch to vcs_info.
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Prompts/prompt_clint_setup11
1 files changed, 6 insertions, 5 deletions
diff --git a/Functions/Prompts/prompt_clint_setup b/Functions/Prompts/prompt_clint_setup
index 154edede1..ba55ca5fc 100644
--- a/Functions/Prompts/prompt_clint_setup
+++ b/Functions/Prompts/prompt_clint_setup
@@ -15,6 +15,8 @@ prompt_clint_setup () {
   local -A pc
   local p_date p_tty p_plat p_ver p_userpwd p_apm p_shlvlhist p_rc p_end p_win
 
+  autoload -Uz vcs_info
+
   pcc[1]=${1:-'red'}
   pcc[2]=${2:-'cyan'}
   pcc[3]=${3:-'green'}
@@ -36,7 +38,7 @@ prompt_clint_setup () {
   [[ -n "$WINDOW" ]] && p_win="$pc['\(']%F{$pcc[4]}$WINDOW$pc['\)']"
 
   p_userpwd="$pc['<']%F{$pcc[3]}%n@%m$p_win%F{$pcc[5]}:%F{$pcc[4]}%~$pc['>']"
-  p_git="%(2v.-%U%2v%u-.)"
+  p_vcs="%(2v.%U%2v%u.)"
 
   p_shlvlhist="%fzsh%(2L./$SHLVL.) %B%h%b "
   p_rc="%(?..[%?%1v] )"
@@ -46,7 +48,7 @@ prompt_clint_setup () {
 
   prompt="$p_date$p_tty$p_plat$p_ver
 $p_userpwd
-$p_shlvlhist$p_rc$p_git$p_end"
+$p_shlvlhist$p_rc$p_vcs$p_end"
   PS2='%(4_.\.)%3_> %E'
 
   add-zsh-hook precmd prompt_clint_precmd
@@ -63,9 +65,8 @@ prompt_clint_precmd () {
 
   [[ -o interactive ]] && jobs -l
 
-  git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
-  git_ref=$(git-symbolic-ref HEAD 2> /dev/null) || git_ref="(no branch)"
-  psvar[2]=${git_ref#refs/heads/}
+  vcs_info
+  [[ -n $vcs_info_msg_0_ ]] && psvar[2]="$vcs_info_msg_0_"
 }
 
 prompt_clint_setup "$@"