From unknown Tue Aug 19 02:52:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13866 <13866@debbugs.gnu.org> To: bug#13866 <13866@debbugs.gnu.org> Subject: Status: [VC] =?UTF-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax Reply-To: bug#13866 <13866@debbugs.gnu.org> Date: Tue, 19 Aug 2025 09:52:49 +0000 retitle 13866 [VC] =E2=80=98vc-git-root=E2=80=99 is too lax reassign 13866 emacs submitter 13866 ludo@gnu.org (Ludovic Court=C3=A8s) severity 13866 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 04:51:39 2013 Received: (at submit) by debbugs.gnu.org; 4 Mar 2013 09:51:39 +0000 Received: from localhost ([127.0.0.1]:58240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCS3X-0005YZ-40 for submit@debbugs.gnu.org; Mon, 04 Mar 2013 04:51:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCS3R-0005YH-09 for submit@debbugs.gnu.org; Mon, 04 Mar 2013 04:51:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCS35-0004vI-KB for submit@debbugs.gnu.org; Mon, 04 Mar 2013 04:51:13 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-102.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCS35-0004uz-Eh for submit@debbugs.gnu.org; Mon, 04 Mar 2013 04:51:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCS33-0007GJ-4B for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 04:51:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCS30-0004ty-Vr for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 04:51:09 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCS30-0004tt-Sd for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 04:51:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41850) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UCS30-0001wR-Es for bug-emacs@gnu.org; Mon, 04 Mar 2013 04:51:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCS2v-0004rs-N8 for bug-emacs@gnu.org; Mon, 04 Mar 2013 04:51:06 -0500 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=34414 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCS2v-0004p3-Fr for bug-emacs@gnu.org; Mon, 04 Mar 2013 04:51:01 -0500 Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 7646FCC97 for ; Mon, 4 Mar 2013 10:50:51 +0100 (CET) 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 oyjL7osBH5Iq for ; Mon, 4 Mar 2013 10:50:51 +0100 (CET) Received: from pluto (unknown [193.50.110.91]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 413BEC0D0 for ; Mon, 4 Mar 2013 10:50:51 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: bug-emacs@gnu.org Subject: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax 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?= =?utf-8?Q?=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 Date: Mon, 04 Mar 2013 10:50:50 +0100 Message-ID: <87zjyjijd1.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.5 (-------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, =E2=80=98vc-git-root=E2=80=99 as found in Emacs 24.2.1 is too lax: when cal= led from a non-Git directory under $HOME, it ends up returning ~/ because users normally have a ~/.git directory holding a config file. A better definition would be something like this: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline Content-Transfer-Encoding: quoted-printable (defun vc-git-root (file) (lexical-let ((root (vc-find-root file ".git"))) (and (file-in-directory-p root "objects") root))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpUaGFua3MsDQpMdWRv4oCZLg0K --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 05:57:14 2013 Received: (at 13866) by debbugs.gnu.org; 4 Mar 2013 10:57:14 +0000 Received: from localhost ([127.0.0.1]:58302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCT4z-00073o-Eo for submit@debbugs.gnu.org; Mon, 04 Mar 2013 05:57:14 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:60624) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCT4x-00073g-68 for 13866@debbugs.gnu.org; Mon, 04 Mar 2013 05:57:12 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZKJ8R4zDsz3hhqF; Mon, 4 Mar 2013 11:56:55 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3ZKJ8R4HNNzbbm4; Mon, 4 Mar 2013 11:56:55 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id rvhOyNHVykEH; Mon, 4 Mar 2013 11:56:52 +0100 (CET) X-Auth-Info: ZwpL8vIa3E2bGAvqGWVIh5buhOYGwAYMNQEhyOuZljM= Received: from hawking.suse.de (nat.nue.novell.com [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 4 Mar 2013 11:56:52 +0100 (CET) From: Andreas Schwab To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#13866: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax References: <87zjyjijd1.fsf@gnu.org> X-Yow: I know how to get the hostesses released! Give them their own television series! Date: Mon, 04 Mar 2013 11:56:51 +0100 In-Reply-To: <87zjyjijd1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 04 Mar 2013 10:50:50 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13866 Cc: 13866@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) ludo@gnu.org (Ludovic Court=C3=A8s) writes: > =E2=80=98vc-git-root=E2=80=99 as found in Emacs 24.2.1 is too lax: when= called from a > non-Git directory under $HOME, it ends up returning ~/ because users > normally have a ~/.git directory holding a config file. Do they? Who created it? Andreas. --=20 Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 08:17:15 2013 Received: (at 13866-done) by debbugs.gnu.org; 4 Mar 2013 13:17:15 +0000 Received: from localhost ([127.0.0.1]:58362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCVGV-0002q4-3R for submit@debbugs.gnu.org; Mon, 04 Mar 2013 08:17:15 -0500 Received: from xanadu.aquilenet.fr ([88.191.123.111]:42594) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCVGR-0002pt-UK for 13866-done@debbugs.gnu.org; Mon, 04 Mar 2013 08:17:14 -0500 Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id BE5F7C99C; Mon, 4 Mar 2013 14:16:55 +0100 (CET) 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 G-NIQvwpVL6h; Mon, 4 Mar 2013 14:16:55 +0100 (CET) Received: from pluto (unknown [193.50.110.91]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 83C97C6DC; Mon, 4 Mar 2013 14:16:55 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Andreas Schwab Subject: Re: bug#13866: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax References: <87zjyjijd1.fsf@gnu.org> 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?= =?utf-8?Q?=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 Date: Mon, 04 Mar 2013 14:16:55 +0100 In-Reply-To: (Andreas Schwab's message of "Mon, 04 Mar 2013 11:56:51 +0100") Message-ID: <877glngv94.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 13866-done Cc: 13866-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.2 (/) Andreas Schwab skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> =E2=80=98vc-git-root=E2=80=99 as found in Emacs 24.2.1 is too lax: when = called from a >> non-Git directory under $HOME, it ends up returning ~/ because users >> normally have a ~/.git directory holding a config file. > > Do they? Who created it? I did, but now I realize that ~/.gitconfig is what matters nowadays (or maybe ~/.git/config never mattered, even.) Sorry for the noise. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 09:58:57 2013 Received: (at 13866) by debbugs.gnu.org; 4 Mar 2013 14:58:57 +0000 Received: from localhost ([127.0.0.1]:58829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCWqu-00077f-MW for submit@debbugs.gnu.org; Mon, 04 Mar 2013 09:58:56 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:52003) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCWqs-00077R-NH for 13866@debbugs.gnu.org; Mon, 04 Mar 2013 09:58:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLvL/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFFxLvL/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2974291" Received: from 69-196-187-203.dsl.teksavvy.com (HELO pastel.home) ([69.196.187.203]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Mar 2013 09:58:32 -0500 Received: by pastel.home (Postfix, from userid 20848) id A2E3B6BF75; Mon, 4 Mar 2013 09:58:33 -0500 (EST) From: Stefan Monnier To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Subject: Re: bug#13866: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax Message-ID: References: <87zjyjijd1.fsf@gnu.org> Date: Mon, 04 Mar 2013 09:58:33 -0500 In-Reply-To: <87zjyjijd1.fsf@gnu.org> ("Ludovic =?iso-8859-1?Q?Court=E8s?= =?iso-8859-1?Q?=22's?= message of "Mon, 04 Mar 2013 10:50:50 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13866 Cc: 13866@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) > 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"). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 10:11:35 2013 Received: (at submit) by debbugs.gnu.org; 4 Mar 2013 15:11:35 +0000 Received: from localhost ([127.0.0.1]:58838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCX38-0007Q0-Uv for submit@debbugs.gnu.org; Mon, 04 Mar 2013 10:11:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48420) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UCX36-0007Pm-2J for submit@debbugs.gnu.org; Mon, 04 Mar 2013 10:11:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCX2i-0003VZ-LT for submit@debbugs.gnu.org; Mon, 04 Mar 2013 10:11:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:34603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCX2i-0003VT-If for submit@debbugs.gnu.org; Mon, 04 Mar 2013 10:11:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCX2f-00012Y-Db for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 10:11:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCX2c-0003UH-N0 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 10:11:05 -0500 Received: from ristopher.com ([146.185.21.93]:59798 helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCX2c-0003U0-Ei for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2013 10:11:02 -0500 Received: by saturn.ch.ristopher.com (Postfix, from userid 0) id 1F61920283; Mon, 4 Mar 2013 15:11:00 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com; s=mail; t=1362409860; bh=gNWOaUAitqEPzNqIHADdwp1i8iyvGVeF6VqllqvQPkk=; h=From:To:Subject:In-Reply-To:Message-ID:References:MIME-Version: Content-Type:Date; b=fJbaWdlMs2u4MoH4dxk8GahHCiDzu+4tODez36VqxAQx0WwoedY0GAorJPnYHzF74 3xCAeX57GtVHriOlzqlwZjHbQmYticTLep/GbecRZwSioFIavMWJRie1yUoCaN0TyC /CukG/6ZWA0iSlvxXS+g5+DrRfvctiN6m8QXjZxI= From: Christopher Schmidt To: bug-gnu-emacs@gnu.org Subject: Re: bug#13866: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax In-Reply-To: (Stefan Monnier's message of "Mon, 04 Mar 2013 09:58:33 -0500") Message-ID: <87ppzfjj3w@ch.ristopher.com> References: <87zjyjijd1.fsf@gnu.org> Mail-Followup-To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain Date: Mon, 4 Mar 2013 15:11:00 +0000 (GMT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) Stefan Monnier writes: > And of course you could have used simply (vc-find-root file > ".git/objects"). That is not right. .git in a git root directory might be a regular file. Christopher From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 04 11:00:35 2013 Received: (at 13866) by debbugs.gnu.org; 4 Mar 2013 16:00:35 +0000 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 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 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) 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) 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) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Stefan Monnier Subject: Re: bug#13866: [VC] =?utf-8?Q?=E2=80=98vc-git-root=E2=80=99?= is too lax References: <87zjyjijd1.fsf@gnu.org> 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?= =?utf-8?Q?=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 Date: Mon, 04 Mar 2013 17:00:14 +0100 In-Reply-To: (Stefan Monnier's message of "Mon, 04 Mar 2013 09:58:33 -0500") Message-ID: <87y5e3duk1.fsf@gnu.org> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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"). [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4439] X-Debbugs-Envelope-To: 13866 Cc: 13866@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) 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. From unknown Tue Aug 19 02:52:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 02 Apr 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator