From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] vcs_info '%r' doesn't work properly when entered a subdirectory of a git repository through a symlink
Date: Thu, 21 Nov 2013 08:16:28 -0800 [thread overview]
Message-ID: <131121081628.ZM13038@torch.brasslantern.com> (raw)
In-Reply-To: <528D65C2.2080607@topbug.net>
On Nov 20, 5:45pm, Hong Xu wrote:
} Subject: [BUG] vcs_info '%r' doesn't work properly when entered a subdirec
}
} 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
This is coming from VCS_INFO_get_data_git, in this expression:
gitbase=${PWD%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}}
This is computing the value for %R, which is then converted with the :t
modifier into a path tail for %r.
I believe the issue is that because you've symlink'd your way into a
subdirectory, $PWD no longer includes the full path that is being
returned by --show-prefix, so the substitution does nothing.
What I don't know is the desired outcome. Try replacing $PWD in that
function with $(pwd -P) and see if that gives you what you want? Is
that what everyone would expect here?
next prev parent reply other threads:[~2013-11-21 16:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 1:45 Hong Xu
2013-11-21 16:16 ` Bart Schaefer [this message]
2013-11-21 19:12 ` Hong Xu
2013-11-21 23:13 ` Aaron Schrab
2013-11-21 23:26 ` Aaron Schrab
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=131121081628.ZM13038@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).