From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6669 invoked by alias); 21 Nov 2013 23:21:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32037 Received: (qmail 27636 invoked from network); 21 Nov 2013 23:21:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 Date: Thu, 21 Nov 2013 18:13:19 -0500 From: Aaron Schrab To: Hong Xu Cc: zsh-workers@zsh.org Subject: Re: vcs_info '%r' doesn't work properly when entered a subdirectory of a git repository through a symlink Message-ID: <20131121231319.GA23989@pug.qqx.org> Mail-Followup-To: Hong Xu , zsh-workers@zsh.org References: <528D65C2.2080607@topbug.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <528D65C2.2080607@topbug.net> User-Agent: Mutt/1.5.22+36 (g7db327c) (2013-10-16) At 17:45 -0800 20 Nov 2013, Hong Xu 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?