projects
/
grml-etc-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fb5ef8c
)
zshrc: Make vcs_info() detect $GIT_DIR/svn and set vcs to 'git-svn'
author
Frank Terbeck
<ft@grml.org>
Wed, 27 Aug 2008 20:36:44 +0000
(22:36 +0200)
committer
Frank Terbeck
<ft@grml.org>
Wed, 27 Aug 2008 20:36:44 +0000
(22:36 +0200)
debian/changelog
patch
|
blob
|
history
etc/zsh/zshrc
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index
beafea2
..
4c7a499
100644
(file)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-2,8
+2,10
@@
grml-etc-core (0.3.53) unstable; urgency=low
* zshrc: Handle a state of git in vcs_info(), when a normal
rebase conflicts
* zshrc: Handle a state of git in vcs_info(), when a normal
rebase conflicts
+ * zshrc: Make vcs_info() detect $GIT_DIR/svn and set the name of the
+ vcs to 'git-svn'
- -- Frank Terbeck <ft@grml.org> Wed, 27 Aug 2008
13:07:4
9 +0200
+ -- Frank Terbeck <ft@grml.org> Wed, 27 Aug 2008
22:35:0
9 +0200
grml-etc-core (0.3.52) unstable; urgency=low
grml-etc-core (0.3.52) unstable; urgency=low
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
6603e03
..
1914d39
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-1077,6
+1077,11
@@
fi
#
# This *requires* 'setopt prompt_subst'.
# }}}
#
# 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
VCS_INFO_format () { # {{{
local msg
@@
-1182,16
+1187,14
@@
VCS_INFO_git_get_data () { # {{{
setopt localoptions extendedglob
local gitdir gitbase gitbranch gitaction 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
if [[ -z ${gitdir} ]] || [[ -z ${gitbranch} ]] ; then
return
fi
+ VCS_INFO_adjust
gitaction="$(VCS_INFO_git_getaction ${gitdir})"
msg=$(VCS_INFO_format ${gitaction})
gitaction="$(VCS_INFO_git_getaction ${gitdir})"
msg=$(VCS_INFO_format ${gitaction})
@@
-1284,7
+1287,11
@@
VCS_INFO_bzr_detect() {
}
VCS_INFO_git_detect() {
}
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
}
return 1
}