Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vcs_info '%r' doesn't work properly when entered a subdirectory of a git repository through a symlink
- X-seq: zsh-workers 32037
- From: Aaron Schrab <aaron@xxxxxxxxxx>
- To: Hong Xu <hong@xxxxxxxxxx>
- 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:13:19 -0500
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <528D65C2.2080607@topbug.net>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Hong Xu <hong@xxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <528D65C2.2080607@topbug.net>
At 17:45 -0800 20 Nov 2013, Hong Xu <hong@xxxxxxxxxx> 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:
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}
Does that fix the problem for you?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author