Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Misc/vcs_info-examples - avoid showing remote branch



Hello,

This is a patch for Misc/vcs_info-examples from the ZSH git repo:
http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob;f=Misc/vcs_info-examples

It prevents the display of remote branch if the remote branch has
the same name as the local branch (minus the remote, of course).

Cheers.

--- gitweb.cgi.txt.old	2011-10-19 03:13:31.467973933 -0700
+++ gitweb.cgi.txt	2011-10-19 03:14:05.502458051 -0700
@@ -205,7 +205,7 @@
     remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
         --symbolic-full-name 2>/dev/null)/refs\/remotes\/}

-    if [[ -n ${remote} ]] ; then
+    if [[ -n ${remote} && ${remote#*/} != ${hook_com[branch]} ]] ; then
         hook_com[branch]="${hook_com[branch]} [${remote}]"
     fi
 }

-- 
If a listener nods his head when you're explaining your program, wake
him up.

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author