From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: vc-find-root and nonexistent drives Date: Sat, 16 Feb 2008 09:29:36 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203172191 8715 80.91.229.12 (16 Feb 2008 14:29:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Feb 2008 14:29:51 +0000 (UTC) Cc: Emacs Devel To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 16 15:30:15 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JQO3S-0002OI-UQ for ged-emacs-devel@m.gmane.org; Sat, 16 Feb 2008 15:30:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQO2y-0002OI-GZ for ged-emacs-devel@m.gmane.org; Sat, 16 Feb 2008 09:29:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQO2u-0002O3-5A for emacs-devel@gnu.org; Sat, 16 Feb 2008 09:29:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQO2s-0002Nr-Sw for emacs-devel@gnu.org; Sat, 16 Feb 2008 09:29:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQO2s-0002No-Pz for emacs-devel@gnu.org; Sat, 16 Feb 2008 09:29:38 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JQO2s-000384-IK for emacs-devel@gnu.org; Sat, 16 Feb 2008 09:29:38 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAPqBtkdMCpRc/2dsb2JhbACsd4EC X-IronPort-AV: E=Sophos;i="4.25,361,1199682000"; d="scan'208";a="14596955" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 16 Feb 2008 09:29:36 -0500 Original-Received: from pastel.home ([76.10.148.92]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id WQT99636; Sat, 16 Feb 2008 09:29:36 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 6C8767FCA; Sat, 16 Feb 2008 09:29:36 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Sat, 16 Feb 2008 04:52:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89248 Archived-At: > The reason is that currently, `vc-find-root' does: > (while (not (file-directory-p file)) > (setq file (file-name-directory (directory-file-name file)))) > which assumes that the output of `file-name-directory' will be > different in each iteration of the while loop. I don't follow. The code in the 22 branch does: (while (not (or root (null file) ;; As a heuristic, we stop looking up the hierarchy of ;; directories as soon as we find a directory belonging ;; to another user. This should save us from looking in ;; things like /net and /afs. This assumes that all the ;; files inside a project belong to the same user. (not (equal user (nth 2 (file-attributes file)))) (string-match vc-ignore-dir-regexp file))) (if (file-exists-p (expand-file-name witness file)) (setq root file) (if (equal file (setq file (file-name-directory (directory-file-name file)))) (setq file nil)))) where you see (last 3 lines) that it checks that `file' does change at each iteration. > That is not so when the > drive does not exist, for example: > (file-name-directory (directory-file-name "g:/")) => "g:/" So the `equal' test should trigger and force exiting the loop. I.e. there much be something else at play here. Stefan