zsh-workers
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: Bart Schaefer <schaefer@brasslantern.com>
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
Date: Wed, 27 Nov 2013 23:23:42 -0800	[thread overview]
Message-ID: <5296EF7E.1010407@topbug.net> (raw)
In-Reply-To: <528EB952.8010309@topbug.net>

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

On 11/21/13, 5:54 PM, Hong Xu wrote:
> On Thu Nov 21 16:10:50 2013, Bart Schaefer wrote:
>> On Nov 21,  6:13pm, Aaron Schrab wrote:
>> }
>> } 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.
>>
>> That's probably true, but looking at VCS_INFO_reposub I think applying
>> 31985 is still going to break %S in the way Hong already mentioned.
>
> I just tested this patch, yes it did break %S.


I tested the attached patch and it fixes the issue without breaking %S 
for me. Please give it a try, and if it is good, could you include this 
patch?

Thanks!
Hong


[-- Attachment #2: vcs_git.patch --]
[-- Type: text/plain, Size: 1006 bytes --]

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index c44be39..cd8f064 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=${$(pwd -P)%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}}
 rrn=${gitbase:t}
 
 local patchdir=${gitdir}/patches/${gitbranch}
diff --git a/Functions/VCS_Info/VCS_INFO_reposub b/Functions/VCS_Info/VCS_INFO_reposub
index 0fab863..1c16f0e 100644
--- a/Functions/VCS_Info/VCS_INFO_reposub
+++ b/Functions/VCS_Info/VCS_INFO_reposub
@@ -5,9 +5,9 @@
 setopt localoptions extendedglob NO_shwordsplit
 local base=${1%%/##}
 
-[[ ${PWD} == ${base}/* ]] || {
+[[ $(pwd -P) == ${base}/* ]] || {
     printf '.'
     return 1
 }
-printf '%s' ${PWD#$base/}
+printf '%s' ${$(pwd -P)#$base/}
 return 0

  reply	other threads:[~2013-11-28  7:24 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
2013-11-22  0:10   ` Bart Schaefer
2013-11-22  1:54     ` Hong Xu
2013-11-28  7:23       ` Hong Xu [this message]
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=5296EF7E.1010407@topbug.net \
    --to=hong@topbug.net \
    --cc=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).