zsh-users
 help / color / mirror / code / Atom feed
From: "Suraj N. Kurapati" <sunaku@gmail.com>
To: zsh-users@zsh.org
Subject: [PATCH] Misc/vcs_info-examples - avoid showing remote branch
Date: Wed, 19 Oct 2011 03:36:59 -0700	[thread overview]
Message-ID: <20111019033659.7718667e@gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2011-10-19 10:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 10:36 Suraj N. Kurapati [this message]
2011-10-19 11:22 ` Frank Terbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111019033659.7718667e@gmail.com \
    --to=sunaku@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).