Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Misc/vcs_info-examples - avoid showing remote branch
- X-seq: zsh-workers 29827
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Misc/vcs_info-examples - avoid showing remote branch
- Date: Wed, 19 Oct 2011 19:08:26 +0200
- Cc: "Suraj N. Kurapati" <sunaku@xxxxxxxxx>
- In-reply-to: <87vcrli5tf.fsf@ft.bewatermyfriend.org> (Frank Terbeck's message of "Wed, 19 Oct 2011 13:22:52 +0200")
- 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
- References: <20111019033659.7718667e@gmail.com> <87vcrli5tf.fsf@ft.bewatermyfriend.org>
[moved to -workers]
The patch doesn't quite apply, since it's against `gitweb.cgi.txt'. But
since it is only one line, that's not critical.
I'll actually commit the following. Since vcs_info-examples is only a
file full of - well - examples, it makes sense to have both ways
presented to the user. FWIW, I can see users want either way.
Regards, Frank
Misc/vcs_info-examples | 4 ++++
1 file changed, 4 insertions(+)
Index: Misc/vcs_info-examples
===================================================================
RCS file: /cvsroot/zsh/zsh/Misc/vcs_info-examples,v
retrieving revision 1.6
diff -u -p -r1.6 vcs_info-examples
--- Misc/vcs_info-examples 1 Jun 2011 21:21:04 -0000 1.6
+++ Misc/vcs_info-examples 19 Oct 2011 17:01:53 -0000
@@ -205,7 +205,11 @@ function +vi-git-remotebranch() {
remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \
--symbolic-full-name 2>/dev/null)/refs/remotes/}
+ # The first test will show a tracking branch whenever there is one. The
+ # second test, however, will only show the remote branch's name if it
+ # differs from the local one.
if [[ -n ${remote} ]] ; then
+ #if [[ -n ${remote} && ${remote#*/} !=3D ${hook_com[branch]} ]] ; then
hook_com[branch]="${hook_com[branch]} [${remote}]"
fi
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author