about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2010-08-02 21:05:54 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2010-08-02 21:05:54 +0000
commit67e6e030d2ff6a11f341240974e056e8af0d80fe (patch)
treeee1cb0436b586f91c56269ad6a9a26805a8f5d71
parentedcd71603de1a202984d2730deffacab9d5475d8 (diff)
downloadzsh-67e6e030d2ff6a11f341240974e056e8af0d80fe.tar.gz
zsh-67e6e030d2ff6a11f341240974e056e8af0d80fe.tar.xz
zsh-67e6e030d2ff6a11f341240974e056e8af0d80fe.zip
Seth House: 28115: Another git example vcs_info hook.
-rw-r--r--ChangeLog7
-rw-r--r--Misc/vcs_info-examples16
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a058415c..e3024200a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* Daiki Ueno: 28112: Src/Zle/zle_refresh.c: missing parentheses
@@ -13468,5 +13473,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5044 $
+* $Revision: 1.5045 $
 *****************************************************
diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples
index b76990681..bc10a2179 100644
--- a/Misc/vcs_info-examples
+++ b/Misc/vcs_info-examples
@@ -178,6 +178,22 @@ function +vi-git-st() {
     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
 # This may indicate that running `hg up` will do something
 # NOTE: the branchheads.cache file is not updated with every Mercurial