From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: vc-git bug with top-level repositories Date: Wed, 20 Aug 2008 11:22:01 +0900 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> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219198954 14675 80.91.229.12 (20 Aug 2008 02:22:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2008 02:22:34 +0000 (UTC) Cc: Dan Nicolaescu , ams@gnu.org, claus.klingberg@gmail.com, paul.r.ml@gmail.com, emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 20 04:23:26 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 1KVdM1-0002aW-CO for ged-emacs-devel@m.gmane.org; Wed, 20 Aug 2008 04:23:21 +0200 Original-Received: from localhost ([127.0.0.1]:52883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVdL3-0002Iu-N9 for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 22:22:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVdKy-0002Ic-T5 for emacs-devel@gnu.org; Tue, 19 Aug 2008 22:22:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVdKx-0002IQ-8l for emacs-devel@gnu.org; Tue, 19 Aug 2008 22:22:16 -0400 Original-Received: from [199.232.76.173] (port=37927 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVdKx-0002IN-3w for emacs-devel@gnu.org; Tue, 19 Aug 2008 22:22:15 -0400 Original-Received: from tyo202.gate.nec.co.jp ([202.32.8.206]:34129) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVdKp-0002qG-QJ; Tue, 19 Aug 2008 22:22:08 -0400 Original-Received: from relay11.aps.necel.com ([10.29.19.46]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m7K2M2Lr024847; Wed, 20 Aug 2008 11:22:03 +0900 (JST) Original-Received: from relay31.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay11.aps.necel.com with ESMTP; Wed, 20 Aug 2008 11:22:03 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay31.aps.necel.com with ESMTP; Wed, 20 Aug 2008 11:22:03 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id D8E7E478; Wed, 20 Aug 2008 11:22:02 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (Andreas Schwab's message of "Tue, 19 Aug 2008 23:34:03 +0200") Original-Lines: 28 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (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:102700 Archived-At: >> 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. ... and it would have to be done for every vcs supported by Emacs... As Dan says, there's a reason Emacs does it the way it does. Running (or at least trying to run) 5-6 external programs, for every file visited, is not a very nice idea, even if the programs are pretty fast... :-) I suppose it is true that if Emacs were to use the "run external programs to check" method, there are probably various optimizations that could be done -- e.g. only do it once for the first file visited in any given directory and assume the resulting status holds for subsequent files in the same directory. However I think such optimizations also require making various assumptions (in this case, for instance, that the state won't change), and have their own tradeoffs. -Miles -- Discriminate, v.i. To note the particulars in which one person or thing is, if possible, more objectionable than another.