From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.emacs.bugs Subject: bug#13866: [VC] =?UTF-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax Date: Mon, 04 Mar 2013 17:00:14 +0100 Message-ID: <87y5e3duk1.fsf@gnu.org> References: <87zjyjijd1.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362412858 3614 80.91.229.3 (4 Mar 2013 16:00:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Mar 2013 16:00:58 +0000 (UTC) Cc: 13866@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 04 17:01:20 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCXpF-0001O1-S1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2013 17:01:17 +0100 Original-Received: from localhost ([::1]:48274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCXou-0008M0-IJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2013 11:00:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCXon-0008L2-BP for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 11:00:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCXol-0002fF-Lb for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 11:00:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCXol-0002f6-Gv for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 11:00:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UCXp0-00009S-58 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 11:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Mar 2013 16:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13866 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13866-submit@debbugs.gnu.org id=B13866.1362412835545 (code B ref 13866); Mon, 04 Mar 2013 16:01:01 +0000 Original-Received: (at 13866) by debbugs.gnu.org; 4 Mar 2013 16:00:35 +0000 Original-Received: from localhost ([127.0.0.1]:58874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCXoY-00008j-Q4 for submit@debbugs.gnu.org; Mon, 04 Mar 2013 11:00:35 -0500 Original-Received: from xanadu.aquilenet.fr ([88.191.123.111]:41778) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCXoW-00008a-BP for 13866@debbugs.gnu.org; Mon, 04 Mar 2013 11:00:33 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 2D42BC93C; Mon, 4 Mar 2013 17:00:15 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YIC09b6lDpIk; Mon, 4 Mar 2013 17:00:15 +0100 (CET) Original-Received: from pluto (unknown [193.50.110.91]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id E4B85B36A; Mon, 4 Mar 2013 17:00:14 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?UTF-8?Q?Vent=C3=B4se?= an 221 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Stefan Monnier's message of "Mon, 04 Mar 2013 09:58:33 -0500") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72077 Archived-At: Stefan Monnier skribis: >> A better definition would be something like this: >> (defun vc-git-root (file) >> (lexical-let ((root (vc-find-root file ".git"))) >> (and (file-in-directory-p root "objects") >> root))) > > Beside the fact that ~/.git is not the config directory, the above code > has some problems: > > vc-git.el uses lexical-binding, so using lexical-let in it is a bad idea. > file-in-directory-p sounds completely wrong here. You want to use > (file-directory-p (expand-file-name "objects" root)) instead. > > And of course you could have used simply (vc-find-root file ".git/objects= "). Indeed, point taken! Ludo=E2=80=99.