Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/2] Added Git example to vcs_info-example to show the remote branch name
- X-seq: zsh-workers 28115
- From: Seth House <seth@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/2] Added Git example to vcs_info-example to show the remote branch name
- Date: Mon, 2 Aug 2010 12:36:52 -0600
- Cc: Seth House <seth@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer; bh=CtSABN0lrpvLr0RqFS+lnJe2CDkdEcEL2vxjEO+4l/E=; b=etWiKWtgEEioc+jG2e3WGMXc9UTyetWakQUrBYMt3eZvnY3M+exP2Xx4CYAMmHwXrb LV8tH9AHVNwExWbqeyd2j1IKMX4BQYLuhHEATQSBW+Z8fTe249oM8H50AUMIxoLMXRyG G2CuWmhztVsxbSCjtbo0q3MU75JjSLGLl0qvI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=ipEL+i0t2zpm7eeOallFE8Igi5nSgArLw/Og4oRhL8vABbei5eW76UWQVv/H7sc2C2 eF0OvfO8Ryh/JN+pyid6dRtvXjkn+U5KMa98ulwask7wfn+dJemICL6CuwxTU+IND0Fj kY4NEwZWtz4jzulnpg/bbAa7EexA5r48dPGBA=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Sender: Seth House <whiteinge@xxxxxxxxx>
---
Misc/vcs_info-examples | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples
index b769906..bc10a21 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
--
1.7.2
Messages sorted by:
Reverse Date,
Date,
Thread,
Author