From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20686 invoked by alias); 30 May 2015 11:20:19 -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: 35337 Received: (qmail 23346 invoked from network); 30 May 2015 11:20:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 From: Frank Terbeck To: Hong Xu Cc: zsh-workers@zsh.org Subject: Re: [BUG] vcs_info_msg_[01]_ is not set correctly in a hg repository which is in a subdirectory of a git repository In-Reply-To: <87h9quifqj.fsf@home.hong.me> (Hong Xu's message of "Sat, 30 May 2015 02:20:20 -0700") References: <87h9quifqj.fsf@home.hong.me> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Date: Sat, 30 May 2015 13:13:36 +0200 Message-ID: <87617axqqn.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Hong Xu wrote: > If we have a directory tree like the following: > > - .git > | > -- .hg > > vcs_info_msg_[01]_ are not set correctly. The hg repository is ignored > and only the git repository is recognized. I have enabled both git and > hg for vcs_info. [...] > Instead, to get the correct result, one should detect current directory > for all VCS, then one level up and detect all VCS again, until '/' is > met. Sorry, to gain the best possible performance, vcs_info elects to take shortcuts with systems that allow it. Git for example provides such a shortcut, in that you can ask it if the current directory is a git working directory. In order to make this work, you can put hg before git in the "enable" style in your configuration. You can even have "enable" be an "evaluated" style to set its value depending in your current directory. I am firmly against performing possibly complex and expensive detection to support nested version control situations. Regards, Frank