zsh-users
 help / color / mirror / code / Atom feed
* [PATCH] Misc/vcs_info-examples - avoid showing remote branch
@ 2011-10-19 10:36 Suraj N. Kurapati
  2011-10-19 11:22 ` Frank Terbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Suraj N. Kurapati @ 2011-10-19 10:36 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Misc/vcs_info-examples - avoid showing remote branch
  2011-10-19 10:36 [PATCH] Misc/vcs_info-examples - avoid showing remote branch Suraj N. Kurapati
@ 2011-10-19 11:22 ` Frank Terbeck
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2011-10-19 11:22 UTC (permalink / raw)
  To: zsh-users

Suraj N. Kurapati wrote:
[...]
> It prevents the display of remote branch if the remote branch has
> the same name as the local branch (minus the remote, of course).
[...]
> -    if [[ -n ${remote} ]] ; then
> +    if [[ -n ${remote} && ${remote#*/} != ${hook_com[branch]} ]] ; then

I like that. I'll apply it when I get home.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-19 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-19 10:36 [PATCH] Misc/vcs_info-examples - avoid showing remote branch Suraj N. Kurapati
2011-10-19 11:22 ` Frank Terbeck

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).