emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vc-git bug with top-level repositories


From: Andreas Schwab
Subject: Re: vc-git bug with top-level repositories
Date: Tue, 19 Aug 2008 23:34:03 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

"Alfred M. Szmidt" <address@hidden> 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.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]