vcs to 'git-svn'
* zshrc: Handle .hg subdirectories, that are not the .hg subdirectory
of a mercurial repository. Found by Karl Voit.
+ * zshrc: Give the user the opportunity to switch the vcs_info prompt
+ off for certain version control systems.
- -- Frank Terbeck <ft@grml.org> Fri, 29 Aug 2008 19:08:28 +0200
+ -- Frank Terbeck <ft@grml.org> Fri, 29 Aug 2008 19:46:35 +0200
grml-etc-core (0.3.52) unstable; urgency=low
# (like an interactive rebase or a merge conflict)
# enable - check in the 'init' context. If set to false,
# vcs_info() will do nothing.
+# disable - provide a list of systems, you don't want
+# the prompt to check for repositories (checked
+# in the 'init' context, too).
#
# The default values for these in all contexts are:
# promptformat " (%s)-[%b|%a]-"
#
# Not all vcs backends may support all replacements
#
+# Examples:
+# Don't use vcs_info at all (even though it's in your prompt):
+# % zstyle ':vcs_info:*' enable false
+#
+# Don't provide prompt info for bzr and svk:
+# % zstyle ':vcs_info:*' disable bzr svk
+#
+# Provide a prompt specifically for git:
+# % zstyle ':vcs_info:git' promptformat ' GIT, BABY! [%b]'
+# % zstyle ':vcs_info:git' promptactionformat ' GIT ACTION! [%b|%a]'
+#
# If you want colors, make sure you enclose the color codes in %{...%}, because
-# the string provided by vcs_info() is commonly used for prompts.
+# the string provided by vcs_info() is used for prompts.
#
# Example: PROMPT='%(?..[%?]-)%3~%$(vcs_info)#'
#
vcs_info () { # {{{
local string
local -i found
- local -a VCSs
+ local -a VCSs disabled
local -x vcs
local -Ax vcs_comm
vcs="init"
zstyle -T ":vcs_info:${vcs}" "enable" || return 0
+ zstyle -a ":vcs_info:${vcs}" "disable" disabled
VCSs=(git hg bzr svn svk)
(( found = 0 ))
for vcs in ${VCSs} ; do
+ [[ -n ${(M)disabled:#${vcs}} ]] && continue
vcs_comm=()
VCS_INFO_${vcs}_detect && (( found = 1 )) && break
done