mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
Seth House: 28115: Another git example vcs_info hook.
This commit is contained in:
parent
edcd71603d
commit
67e6e030d2
2 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-08-02 Frank Terbeck <ft@bewatermyfriend.org>
|
||||||
|
|
||||||
|
* Seth House: 28115: Misc/vcs_info-examples: Another git example
|
||||||
|
hook.
|
||||||
|
|
||||||
2010-08-02 Peter Stephenson <pws@csr.com>
|
2010-08-02 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* Daiki Ueno: 28112: Src/Zle/zle_refresh.c: missing parentheses
|
* Daiki Ueno: 28112: Src/Zle/zle_refresh.c: missing parentheses
|
||||||
|
@ -13468,5 +13473,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||||
* $Revision: 1.5044 $
|
* $Revision: 1.5045 $
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
|
@ -178,6 +178,22 @@ function +vi-git-st() {
|
||||||
hook_com[misc]+=${(j:/:)gitstatus}
|
hook_com[misc]+=${(j:/:)gitstatus}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
### git: Show remote branch name for remote-tracking branches
|
||||||
|
zstyle ':vcs_info:git*+set-message:*' hooks git-remotebranch
|
||||||
|
|
||||||
|
function +vi-git-remotebranch() {
|
||||||
|
local remote
|
||||||
|
|
||||||
|
# Are we on a remote-tracking branch?
|
||||||
|
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
|
||||||
|
--symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||||
|
|
||||||
|
if [[ -n ${remote} ]] ; then
|
||||||
|
hook_com[branch]="${hook_com[branch]} [${remote}]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
### hg: Show marker when the working directory is not on a branch head
|
### hg: Show marker when the working directory is not on a branch head
|
||||||
# This may indicate that running `hg up` will do something
|
# This may indicate that running `hg up` will do something
|
||||||
# NOTE: the branchheads.cache file is not updated with every Mercurial
|
# NOTE: the branchheads.cache file is not updated with every Mercurial
|
||||||
|
|
Loading…
Reference in a new issue