GREEN=$'%{\e[1;32m%}'
CYAN=$'%{\e[1;36m%}'
WHITE=$'%{\e[1;37m%}'
- MAGENTA='%{\e[1;35m%}'
- YELLOW='%{\e[1;33m%}'
+ MAGENTA=$'%{\e[1;35m%}'
+ YELLOW=$'%{\e[1;33m%}'
NO_COLOUR=$'%{\e[0m%}'
fi
#
# This *requires* 'setopt prompt_subst'.
# }}}
+VCS_INFO_adjust () { #{{{
+ [[ -n ${vcs_comm[overwrite_name]} ]] && vcs=${vcs_comm[overwrite_name]}
+ return 0
+}
+# }}}
VCS_INFO_format () { # {{{
local msg
setopt localoptions extendedglob
local gitdir gitbase gitbranch gitaction msg
- gitdir="$(git rev-parse --git-dir 2> /dev/null)"
-
- if [[ $? -eq 0 ]] ; then
- gitbranch="$(VCS_INFO_git_getbranch ${gitdir})"
- fi
+ gitdir=${vcs_comm[gitdir]}
+ gitbranch="$(VCS_INFO_git_getbranch ${gitdir})"
if [[ -z ${gitdir} ]] || [[ -z ${gitbranch} ]] ; then
return
fi
+ VCS_INFO_adjust
gitaction="$(VCS_INFO_git_getaction ${gitdir})"
msg=$(VCS_INFO_format ${gitaction})
}
VCS_INFO_git_detect() {
- check_com -c git && git rev-parse --is-inside-work-tree &> /dev/null && return 0
+ if check_com -c git && git rev-parse --is-inside-work-tree &> /dev/null ; then
+ vcs_comm[gitdir]="$(git rev-parse --git-dir 2> /dev/null)" || return 1
+ [[ -d ${vcs_comm[gitdir]}/svn ]] && vcs_comm[overwrite_name]='git-svn'
+ return 0
+ fi
return 1
}
# }}}
# {{{ make sure our environment is clean regarding colors
-for color in BLUE RED GREEN CYAN WHITE ; unset $color
+for color in BLUE RED GREEN CYAN YELLOW MAGENTA WHITE ; unset $color
# }}}
# source another config file if present {{{