From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24745 invoked by alias); 21 Nov 2013 19:13:03 -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: 32036 Received: (qmail 10293 invoked from network); 21 Nov 2013 19:12:47 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=7Ps7CR0ZPCUvHdAXxp9g81o5/GtbULv4T8IStfZmZIA=; b=NSUT0j9U0Z9Uz+in0QPNmYS0dFTt9Hg4vULXlXf2QKsBSrpnSTemt15NWOQBkzItS0 tM3qrbP+IJhm77qdciKcaXCX004Nv5E7V3IXOdcK1AsUr0SNF+pJ7wCO8ILGRmkDpT0m dxJR0ksun/RxatQ5xRgdhXZY9ttOCoYtTtRGEuZYiKf115xxhYhEQVffDR64b1CPBToP FAZkq924Wx4RPpTLOjlbN3SwWkqg7L1f/Dq7ZOQgSiWEQSpLOh7W/EZrbdi9LHkUe8HL qQk18hTe7ravvXjIZdVUjO/HCze14O+TBE0XbNORniuB3EUl8CfPhrRzoHvk9cNZMUn5 F/9w== X-Gm-Message-State: ALoCoQngRzUKBV9CmQOAsumyW2sSC63NJmye1/1CXbwM+9dp6oaECb5a5x51YXtcQ+wa6jwXQM8A X-Received: by 10.68.133.198 with SMTP id pe6mr8042862pbb.10.1385061163393; Thu, 21 Nov 2013 11:12:43 -0800 (PST) Message-ID: <528E5B29.7060605@topbug.net> Date: Thu, 21 Nov 2013 11:12:41 -0800 From: Hong Xu User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Bart Schaefer , 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 References: <528D65C2.2080607@topbug.net> <131121081628.ZM13038@torch.brasslantern.com> In-Reply-To: <131121081628.ZM13038@torch.brasslantern.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/21/13, 8:16 AM, Bart Schaefer wrote: > 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? > Hi Bart, Yes, $(pwd -P) indeed gives the correct %r. However, %S is incorrect then... Hong