From: Aaron Schrab <aaron@schrab.com>
To: Hong Xu <hong@topbug.net>, zsh-workers@zsh.org
Subject: Re: vcs_info '%r' doesn't work properly when entered a subdirectory of a git repository through a symlink
Date: Thu, 21 Nov 2013 18:26:36 -0500 [thread overview]
Message-ID: <20131121232636.GB17739@pug.qqx.org> (raw)
In-Reply-To: <20131121231319.GA23989@pug.qqx.org>
At 18:13 -0500 21 Nov 2013, I wrote:
>At 17:45 -0800 20 Nov 2013, Hong Xu <hong@topbug.net> wrote:
>>The vcs_info '%r' generally works perfect, but when I symlinked a
>>subdirectory of the root dir of the git repository to somewhere
>>else, and cd from the symlink, '%r' doesn't show the correct value,
>>while the git repository can be recognized by zsh.
>
>This sounds like it may be the same issue that was addressed by the
>patch in workers:31985
>(http://www.zsh.org/mla/workers/2013/msg01038.html),
>sent by Clemens Hammacher. It doesn't look like that patch has been
>applied to the git repository yet, but it looks like a good solution
>to me.
>
>Since the patch is short, I'll include the content here:
Looking at the copy that I got back from the mailing list, I see that I
mistakenly let my editor do wrapping on that patch which broke it.
Here's another try at it:
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index c44be39..e6791cb 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -132,7 +132,7 @@ fi
VCS_INFO_adjust
VCS_INFO_git_getaction ${gitdir}
-gitbase=${PWD%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}}
+gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel )
rrn=${gitbase:t}
local patchdir=${gitdir}/patches/${gitbranch}
next prev parent reply other threads:[~2013-11-21 23:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 1:45 [BUG] " Hong Xu
2013-11-21 16:16 ` Bart Schaefer
2013-11-21 19:12 ` Hong Xu
2013-11-21 23:13 ` Aaron Schrab
2013-11-21 23:26 ` Aaron Schrab [this message]
2013-11-22 0:10 ` Bart Schaefer
2013-11-22 1:54 ` Hong Xu
2013-11-28 7:23 ` Hong Xu
2013-11-28 22:03 ` Bart Schaefer
2013-11-29 0:43 ` Hong Xu
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=20131121232636.GB17739@pug.qqx.org \
--to=aaron@schrab.com \
--cc=hong@topbug.net \
--cc=zsh-workers@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).