From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Claus Newsgroups: gmane.emacs.devel Subject: Re: vc-git bug with top-level repositories Date: Tue, 19 Aug 2008 13:01:54 +0200 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=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219143740 21248 80.91.229.12 (19 Aug 2008 11:02:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 11:02:20 +0000 (UTC) Cc: ams@gnu.org, Dan Nicolaescu To: "Emacs Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 13:03:07 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 1KVOzR-0006mQ-Jc for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 13:03:05 +0200 Original-Received: from localhost ([127.0.0.1]:35846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVOyU-0004Ba-IU for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 07:02:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVOyM-00049j-W0 for emacs-devel@gnu.org; Tue, 19 Aug 2008 07:01:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVOyK-00046j-I2 for emacs-devel@gnu.org; Tue, 19 Aug 2008 07:01:57 -0400 Original-Received: from [199.232.76.173] (port=42036 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVOyJ-00046U-VP for emacs-devel@gnu.org; Tue, 19 Aug 2008 07:01:56 -0400 Original-Received: from wf-out-1314.google.com ([209.85.200.173]:13260) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVOyJ-0000rY-Et for emacs-devel@gnu.org; Tue, 19 Aug 2008 07:01:55 -0400 Original-Received: by wf-out-1314.google.com with SMTP id 28so2532345wfc.24 for ; Tue, 19 Aug 2008 04:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=4FfZM8+5Wj3kcP7kR9nrsT/wEkveqRtPAh6Z6e8D5LE=; b=U0Fa/SrHZC3etnHkpzTbYcoww5k6fQyzTN4o2YoP5skF4b2Dqk7OoUCz0QoW5Scx2V ZgYvJ+87LzFVW4KZ1R+at1SJU7FkoLHZ+Jy2EIsUH3srAQj1bEradeOOMZf57ch1UohD S7Uio/iYIocRdOu3kf2l7WdCRSgESneeBO4Z0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=azlrMWogjL6EevVH92ZdAx51wx8I+F25KEOIG9Ir5E4008B/JTMiRYL7dXx5JwoC1k 4g/gRxfBDp5NEJ5UvWE3/XH+PCg8l6SY6l1dAn3241+A+g1PoW3ZrskrslL+BZ/jRQXR UpOVFBdZ35AEjqWcPrUKU89sYcjicn6aDdBU0= Original-Received: by 10.142.180.19 with SMTP id c19mr2462518wff.263.1219143714298; Tue, 19 Aug 2008 04:01:54 -0700 (PDT) Original-Received: by 10.142.177.16 with HTTP; Tue, 19 Aug 2008 04:01:54 -0700 (PDT) In-Reply-To: <200808182031.m7IKVbR7001754@sallyv1.ics.uci.edu> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:102641 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. [...] 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 a workaround, setting the owner on "c:/work/foo/bar" to be equal to "somefile" fixed the problem for me. 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. Claus On Mon, Aug 18, 2008 at 10:31 PM, Dan Nicolaescu wrote: > Claus writes: > > > > Try to figure out why (vc-git-registered "c:/work/foo/bar/somefile.xml") > > > does not return t. > > > > Fair enough :) > > > > Well, it seems like vc-git-registered returns t for files in the > > top-level git-directory (the directory, where .git resides). It does > > however NOT return t for files in subdirectories of where the .git dir > > resides. > > Please "Try to figure out why"... > > > Any recent changes to vc-git-registered that might have caused this? > > No idea. >