Subject: Re: bug#61577: 30.0.50; project-try-vc missing vc-got

From: Omar Polo <[email-masked]>
Date: Sat, 18 Feb 2023 11:48:26 +0100

On 2023/02/18 01:11:10 +0200, Dmitry Gutov <[email-masked]> wrote:
> Version: 29.1
> 
> Hi!
> 
> On 17/02/2023 18:56, Omar Polo wrote:
> 
> > project-try-vc (IIRC) used to loop over all the vc-backends to find the
> > root of a project.  Now, it’s just an hardcoded list in a local
> > variable.  This breaks the project-* functions on Got checkouts.
> > 
> > I can imagine the reason of the change (avoid loading all the vc-*.el
> > files I guess) but it would be nice for this variable to be at least
> > user-configurable, otherwise we will always end up with missing entries.
> 
> The reasons were actually related to performance during the search.

I thought so, thanks for confirming :)

> > (Yeah, one could add their own hooks in project-find-functions for
> > that, but seems replicating stuff that project.el tries to do anyway.)
> > 
> > Attaching a diff that temporarly works around the problem by adding the
> > Got -> .got mapping.
> 
> Thanks for the report, I've pushed your addition and also moved the list 
> to a defvar. Not defcustom, though, to avoid encouraging people from 
> changing it unnecessarily (instead of project-vc-extra-root-markers).
> 
> Originally, I figured all major backends should be covered, but it won't 
> hurt to add one more, especially since vc-got is in ELPA.

I guess that now the (require 'vc-svn) could go away too.

Thanks!

P.S.: thanks also for the explanation about CVS/RCS/SCCS/SRC.  To be
fair I never used the project-* functions in a CVS checkout before
yesterday, and it makes sense not to include them by default.  Well,
maaaybe a vc-cvs-root that walks up until the root of the checkout
could be provided, but I'm not too knowledgable about CVS and my usage
of it is scarce enough that I didn't feel the reason to have it.
Hardly used anything other than C-x v = in CVS checkouts.

diff /home/op/build/emacs
commit - 0be5f7ab6368175953c0a5bcbbd485fd9edda2b0
path + /home/op/build/emacs
blob - 1228c73fee86bbae3727fddd8a9687496849b040
file + lisp/progmodes/project.el
--- lisp/progmodes/project.el
+++ lisp/progmodes/project.el
@@ -512,8 +512,6 @@ See `project-vc-extra-root-markers' for the marker val
 See `project-vc-extra-root-markers' for the marker value format.")
 
 (defun project-try-vc (dir)
-  (defvar vc-svn-admin-directory)
-  (require 'vc-svn)
   ;; FIXME: Learn to invalidate when the value of
   ;; `project-vc-merge-submodules' or `project-vc-extra-root-markers'
   ;; changes.