From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: vc-git bug with top-level repositories Date: Tue, 19 Aug 2008 21:46:35 +0300 Message-ID: References: <200808181433.m7IEX8U3028640@sallyv1.ics.uci.edu> <200808181639.m7IGd1kb005968@sallyv1.ics.uci.edu> <200808182031.m7IKVbR7001754@sallyv1.ics.uci.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1219171628 26573 80.91.229.12 (19 Aug 2008 18:47:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 18:47:08 +0000 (UTC) Cc: ams@gnu.org, dann@ics.uci.edu, emacs-devel@gnu.org To: Claus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 20:47:57 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 1KVWFA-00040l-Jh for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 20:47:48 +0200 Original-Received: from localhost ([127.0.0.1]:60674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVWED-0003vA-Gn for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 14:46:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVWE9-0003uJ-PB for emacs-devel@gnu.org; Tue, 19 Aug 2008 14:46:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVWE9-0003tU-1G for emacs-devel@gnu.org; Tue, 19 Aug 2008 14:46:45 -0400 Original-Received: from [199.232.76.173] (port=43207 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVWE8-0003tN-S4 for emacs-devel@gnu.org; Tue, 19 Aug 2008 14:46:44 -0400 Original-Received: from mtaout1.012.net.il ([84.95.2.1]:51140) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVWE2-0002Fw-GM; Tue, 19 Aug 2008 14:46:38 -0400 Original-Received: from HOME-C4E4A596F7 ([84.229.211.50]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K5V0028W2UF6QM0@i-mtaout1.012.net.il>; Tue, 19 Aug 2008 21:47:04 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 9.1 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:102680 Archived-At: > Date: Tue, 19 Aug 2008 13:01:54 +0200 > From: Claus > Cc: ams@gnu.org, Dan Nicolaescu > > So I dug deeper and it seems like the culprit (at least in my > situation) is in the function vc-find-root: > > This function is traversing the directory tree for a file upwards to > look for (in our case) the root .git directory. If it finds it, the > file will be treated as under GIT-version control. > > As an optimization(?), the following comment describes why traversing > is stopped when the owner of an encountered file/dir changes: > > [...] > ;; 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. > [...] This assumption is only valid for Posix platforms... > So in my case "c:/work/foo/bar/somefile" had a different owner than > "c:/work/foo/bar" so Emacs stopped looking for .git further upwards > --> no version control enabled. ...as this case clearly shows. I think VC needs to limit this heuristic to Posix platforms only. > I'm not yet sure if this is a bug or a feature and will perhaps patch > the code for myself once I've found a better solution (or understand > why checking the owner would make sense - on Windows anyway). > > What still bothers me is that I could swear I didn't have this problem > in my last build from July. Strange.... since nobody touched this > particular function since February this year. Maybe nobody touched that particular function, but I touched file-attributes and directory-files-and-attributes (on MS-Windows) by adding to the emulation of `stat' real owner and primary group of the file, as the NTFS filesystem records them. Could this be the reason for the different behavior?