GNU bug report logs -
#42966
28.0.50; vc-dir: wrong backend
Previous Next
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
Sam Steingold <sds <at> gnu.org> writes:
> My home directory is under `git` and `~/.gitignore` contains `/src` so
> that directories under `~/src` can be handled separately, under
> different repos.
>
> `~/src/cl/clocc` is a managed by mercurial and files there are identified
> by Emacs as such, as indicated in the mode line as `Hg:1234567`.
>
> However, when I do `C-x v d` in a buffer visiting
> `~/src/cl/clocc/src/port/proc.lisp`, I get a prompt
>
> VC status for directory: ~/src/cl/clocc/
>
> (note the _correct_ default mercurial root directory!) and hit RET, I
> get the `*vc-dr*` buffer with
>
> VC backend : Git
> Working dir: ~/src/cl/clocc/
> Branch : master
> Remote : git <at> gitlab.com:sam-s/home.git
> Stash : Nothing stashed
I don't think the .gitignore helps much here -- Emacs doesn't look that
hard at the various backend's ignore capabilities.
But:
(catch 'found
;; First try: find a responsible backend. If this is for registration,
;; it must be a backend under which FILE is not yet registered.
(dolist (backend vc-handled-backends)
(and (vc-call-backend backend 'responsible-p file)
(throw 'found backend))))
This just goes through the backends and the first one that happens to be
able to say "yes" wins. Shouldn't this instead go through all the
backends, and if more than one says "yes", then choose the one with the
most specific path?
Looking at the code, that shouldn't be too hard to implement, because it
seems like responsible-p returns the root path?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 204 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.