GNU bug report logs - #41821
28.0.50; read-directory-name in vc commands should provide defaults from projects

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 11 Jun 2020 23:39:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #144 received at 41821 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 41821 <at> debbugs.gnu.org
Subject: Re: bug#41821: 28.0.50; read-directory-name in vc commands should
 provide defaults from projects
Date: Tue, 30 Jun 2020 15:36:26 +0300
On 30.06.2020 01:58, Juri Linkov wrote:

> Note the same prefix 'project-vc' for vc backend of project.el.
> Then 'project-vc-known-roots' in project.el be like this:
> 
> (defun project-vc-known-roots ()
>    "Return a list of known vc roots."
>    (seq-filter #'project-try-vc (project-known-project-roots)))

You suggested this before. Special-casing a particular backend in a 
general purpose public function is not a good idea.

> Also every command that visits a directory in vc could register their dir
> in the project list when project.el is loaded, for example:
> 
>    (defun vc-dir (dir &optional backend)
>     ...
>     (when (featurep 'project)
>      ;; Add current vc project dir to project list
>      (let ((default-directory dir))
>       (project-current t)))

Having considered it more, I now have more doubt on whether this 
approach is a good idea in general.

See, even when the project backend is VC, there is no guarantee that its 
root will be the repository's root. First, there are submodules (and 
whether a submodule root is a project root is customizable). Second, 
there is an existing feature request to use also some other project root 
markers, even inside VC repos (the "monorepo" case). These might end up 
in the 'vc' backend as well.

So things as they are, I'd rather VC has a separate roots history, or we 
at least put this feature request on hold (and, for now, revert the 
installed patches).




This bug report was last modified 4 years and 319 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.