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-git bug with top-level repositories Date: Wed, 20 Aug 2008 10:34:19 -0400 Message-ID: References: <200808181433.m7IEX8U3028640@sallyv1.ics.uci.edu> <200808181639.m7IGd1kb005968@sallyv1.ics.uci.edu> <200808182031.m7IKVbR7001754@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219242900 19867 80.91.229.12 (20 Aug 2008 14:35:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2008 14:35:00 +0000 (UTC) Cc: dann@ics.uci.edu, ams@gnu.org, Claus , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 20 16:35:52 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 1KVoma-0001Gn-Di for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2008 16:35:33 +0200 Original-Received: from localhost ([127.0.0.1]:58293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVolc-0007wX-Jl for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2008 10:34:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVolY-0007vi-FS for emacs-devel@gnu.org; Wed, 20 Aug 2008 10:34:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVolW-0007vQ-Tx for emacs-devel@gnu.org; Wed, 20 Aug 2008 10:34:28 -0400 Original-Received: from [199.232.76.173] (port=43717 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVolW-0007vM-MJ for emacs-devel@gnu.org; Wed, 20 Aug 2008 10:34:26 -0400 Original-Received: from smtp-05.arnet.com.ar ([200.45.191.5]:49050) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KVolW-00087A-83 for emacs-devel@gnu.org; Wed, 20 Aug 2008 10:34:26 -0400 Original-Received: (qmail 19922 invoked from network); 20 Aug 2008 08:32:32 -0000 Original-Received: from unknown (HELO ceviche.home) (190.30.120.236) by 0 with SMTP; 20 Aug 2008 08:32:32 -0000 Original-Received: by ceviche.home (Postfix, from userid 20848) id 9AF4CB404F; Wed, 20 Aug 2008 10:34:19 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Tue, 19 Aug 2008 21:46:35 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:102725 Archived-At: >> 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 do not see where is the Posixness of my assumption (presumably because Posix is basically all I know). Could you explain? E.g. the above example works just as well in Posix: So in my case "/work/foo/bar/somefile" had a different owner than "/work/foo/bar" so Emacs stopped looking for .git further upwards -> no version control enabled. The assumption of my heuristic is that all the files in a given project belong to the same user. Clearly there's nothing that guarantees it's always true, but for "programming projects", it's probably true in 99.9999% of the cases. If the "project" is a complete OS image OTOH, it's not going to work. > 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? Sounds like it. Stefan