GNU bug report logs - #42966
28.0.50; vc-dir: wrong backend

Previous Next

Package: emacs;

Reported by: sds <at> gnu.org

Date: Fri, 21 Aug 2020 15:16:02 UTC

Severity: minor

Tags: fixed

Merged with 3807, 8179, 8603, 18514

Found in versions 23.3.50, 24.0.50, 24.3, 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Glenn Morris <rgm <at> gnu.org>, sds <at> gnu.org, 42966 <at> debbugs.gnu.org
Subject: bug#42966: 28.0.50; vc-dir: wrong backend
Date: Sun, 18 Oct 2020 10:31:38 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Or, more low-level, if we find that every backend follows the pattern
> of aliasing vc-xyz-responsible-p to vc-xyz-root, and calling
> vc-find-root in the latter's implementation, we could opt for creating
> a backend action that returns the "witness" file name (e.g. ".git"),
> and then construct a regexp from all witness file names, and pass it
> to 'directory-files' as MATCH. Depending on the cost of certain
> things, this could end up being much faster, both locally and
> remotely.

That does sound a lot faster.  Let's see...

./lisp/obsolete/vc-arch.el491:(defalias 'vc-arch-responsible-p 'vc-arch-root)
./lisp/vc/vc-git.el873:(defalias 'vc-git-responsible-p 'vc-git-root)
./lisp/vc/vc-bzr.el646:(defalias 'vc-bzr-responsible-p 'vc-bzr-root
./lisp/vc/vc-hg.el1177:(defalias 'vc-hg-responsible-p 'vc-hg-root)
./lisp/vc/vc-svn.el313:(defalias 'vc-svn-responsible-p 'vc-svn-root)
./lisp/vc/vc-mtn.el201:(defun vc-mtn-responsible-p (file) (vc-mtn-root file))

Then:

./lisp/vc/vc-rcs.el284:(defun vc-rcs-responsible-p (file)

(defun vc-rcs-responsible-p (file)
  (file-directory-p (expand-file-name "RCS"
                                      (if (file-directory-p file)
                                          file
                                        (file-name-directory file)))))

So, basically the same.

./lisp/vc/vc-dav.el142:(defun vc-dav-responsible-p (url)

(defun vc-dav-responsible-p (url)
  t)

:-/

./lisp/vc/vc-src.el248:(defun vc-src-responsible-p (file)

(defun vc-src-responsible-p (file)
  (file-directory-p (expand-file-name ".src"
                                      (if (file-directory-p file)
                                          file
                                        (file-name-directory file)))))


./lisp/vc/vc-sccs.el218:(defun vc-sccs-responsible-p (file)

This one is more complicated:

(defun vc-sccs-responsible-p (file)
  (or (file-directory-p (expand-file-name "SCCS" (file-name-directory file)))
      (stringp (vc-sccs-search-project-dir (or (file-name-directory file) "")
					   (file-name-nondirectory file)))))


./lisp/vc/vc-cvs.el319:(defun vc-cvs-responsible-p (file)

(defun vc-cvs-responsible-p (file)
  (file-directory-p (expand-file-name "CVS"
				      (if (file-directory-p file)
					  file
					(file-name-directory file)))))

So it looks like the only possibly problematic backend is SCCS?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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