From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: vc-git bug with top-level repositories Date: Tue, 19 Aug 2008 23:34:03 +0200 Message-ID: References: <200808181433.m7IEX8U3028640@sallyv1.ics.uci.edu> <200808181639.m7IGd1kb005968@sallyv1.ics.uci.edu> <200808182031.m7IKVbR7001754@sallyv1.ics.uci.edu> <87bpzpxlir.fsf@gmail.com> <200808191656.m7JGuC4t025044@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: quoted-printable X-Trace: ger.gmane.org 1219181676 32100 80.91.229.12 (19 Aug 2008 21:34:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 21:34:36 +0000 (UTC) Cc: claus.klingberg@gmail.com, Dan Nicolaescu , emacs-devel@gnu.org, paul.r.ml@gmail.com To: ams@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 23:35:28 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 1KVYrI-0002u4-QG for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 23:35:21 +0200 Original-Received: from localhost ([127.0.0.1]:54950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVYqK-0001IL-BU for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 17:34:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVYqG-0001I8-Mp for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:34:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVYqF-0001H4-4N for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:34:16 -0400 Original-Received: from [199.232.76.173] (port=51325 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVYqE-0001Gw-T7 for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:34:14 -0400 Original-Received: from cantor.suse.de ([195.135.220.2]:41050 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KVYq7-00043x-SS; Tue, 19 Aug 2008 17:34:08 -0400 Original-Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id AAB3F418FF; Tue, 19 Aug 2008 23:34:03 +0200 (CEST) X-Yow: Why am I in this ROOM in DOWNTOWN PHILADELPHIA? In-Reply-To: (Alfred M. Szmidt's message of "Tue, 19 Aug 2008 16:43:22 -0400") User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:102687 Archived-At: "Alfred M. Szmidt" writes: > > As an other optimisation, can't we let the VCS itself decide > > whether a file is under control or not ? I don't use git, but I > > guess there is some way to check it. In mercurial for example, > > 'hg root' returns the root of the working directory if it > > exists, fails otherwise. Sorry if it has already been > > discussed. > > It intentionally not done that way because, it would be too slow. > The function in question is run every time a file is opened, and > the VC systems are tried in the order they appear in > `vc-handled-backends' until one matches... > > I am not sure I buy this. You already have to check if a file is > registered or not by executing git. But you only have to do that if you positively know that the file is inside a working tree of a VCS. > Doing `git rev-parse --git-dir' or `git rev-parse --is-inside-git-dir' > isn't that much more of a headache. That would then have to be run for _every_ file that Emacs is opening. The check whether a directory is controlled by a VCS should be as fast as possible. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different."