GNU bug report logs - #18514
24.3; vc-dir sometimes guesses the wrong backend

Previous Next

Package: emacs;

Reported by: barry <at> python.org (Barry A. Warsaw)

Date: Sat, 20 Sep 2014 22:42:02 UTC

Severity: minor

Tags: fixed

Merged with 3807, 8179, 8603, 42966

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18514 in the body.
You can then email your comments to 18514 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18514; Package emacs. (Sat, 20 Sep 2014 22:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to barry <at> python.org (Barry A. Warsaw):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Sep 2014 22:42:03 GMT) Full text and rfc822 format available.

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

From: barry <at> python.org (Barry A. Warsaw)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; vc-dir sometimes guesses the wrong backend
Date: Sat, 20 Sep 2014 18:41:11 -0400
vc-dir sometimes guesses the wrong backend.  Here's a reproducible
example.

$ cd /tmp
$ bzr init bzrinit
$ bzr init-repo bzrinitrepo
$ git init bzrinit/gitme
$ git init bzrinitrepo/gitme

M-x vc-dir RET /tmp/bzrinit/gitme
M-x vc-dir RET /tmp/bzrinitrepo/gitme

vc-dir chooses Bzr as the backend for /tmp/bzrinit/gitme but git as the
backend for /tmp/bzrinitrepo/gitme.  In both cases, git should have been
chosen.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.9)
 of 2014-06-06 on brownie, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
System Description:	Ubuntu Utopic Unicorn (development branch)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_COLLATE: en_US.UTF-8
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: VC dir

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <escape> x v c 
- d i r <return> b z r i n i <tab> / g i <tab> <return> 
<escape> x v c - d i r <return> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
r e <tab> g i t m e <tab> <return> <escape> x r e p 
o r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
You can run the command `vc-dir' with C-x v d
error in process sentinel: vc-dir-update: Wrong type argument: arrayp, nil
error in process sentinel: Wrong type argument: arrayp, nil
You can run the command `vc-dir' with C-x v d

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils vc-git vc-bzr vc-sccs vc-svn vc-cvs vc-rcs
vc-dir ewoc vc vc-dispatcher time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18514; Package emacs. (Sun, 21 Sep 2014 21:29:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: barry <at> python.org (Barry A. Warsaw)
Cc: 18514 <at> debbugs.gnu.org
Subject: Re: bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
Date: Sun, 21 Sep 2014 17:28:04 -0400
Barry A. Warsaw wrote:

> vc-dir sometimes guesses the wrong backend.  Here's a reproducible
> example.
>
> $ cd /tmp
> $ bzr init bzrinit
> $ bzr init-repo bzrinitrepo
> $ git init bzrinit/gitme
> $ git init bzrinitrepo/gitme
>
> M-x vc-dir RET /tmp/bzrinit/gitme
> M-x vc-dir RET /tmp/bzrinitrepo/gitme
>
> vc-dir chooses Bzr as the backend for /tmp/bzrinit/gitme but git as the
> backend for /tmp/bzrinitrepo/gitme.  In both cases, git should have been
> chosen.

This is http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8179 (et al) again.

vc currently loops over backends, then the directory tree.
That needs to be reversed, but no-one has gotten round to it.

(For your specific example, you can reorder vc-handled-backends.)





Forcibly Merged 3807 8179 8603 18514. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 21 Sep 2014 21:29:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18514; Package emacs. (Sun, 21 Sep 2014 21:49:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: barry <at> python.org (Barry A. Warsaw)
Cc: 18514 <at> debbugs.gnu.org
Subject: Re: bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
Date: Sun, 21 Sep 2014 17:48:44 -0400
> $ cd /tmp
> $ bzr init bzrinit
> $ bzr init-repo bzrinitrepo
> $ git init bzrinit/gitme
> $ git init bzrinitrepo/gitme

You can skip the "bzr init-repo bzrinitrepo" part since it doesn't make
any difference.  The problem is known: the two loops (the one that
cycles through the VCS backends and the one that cycles through the
various parent directories) are not nested in the right order.

Patch welcome.  In the mean: don't nest projects in each other if they
use the same backend.  Or try to make sure the inner VCS always comes
before the outer one in vc-handled-backends.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18514; Package emacs. (Sun, 21 Sep 2014 22:02:02 GMT) Full text and rfc822 format available.

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

From: Barry Warsaw <barry <at> python.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 18514 <at> debbugs.gnu.org
Subject: Re: bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
Date: Sun, 21 Sep 2014 18:00:53 -0400
[Message part 1 (text/plain, inline)]
On Sep 21, 2014, at 05:48 PM, Stefan Monnier wrote:

>You can skip the "bzr init-repo bzrinitrepo" part since it doesn't make
>any difference.

Right, that was just for illustration.  I had spoken to someone who thought
that maybe vc-dir wasn't handling bzr shared repo directories correctly.

>Patch welcome.  In the mean: don't nest projects in each other if they
>use the same backend.

That won't be possible for me, since my $HOME is under bzr, and project
subdirs under that are of various vcses (including bzr, git, hg, and svn).

>Or try to make sure the inner VCS always comes before the outer one in
>vc-handled-backends.

Is it possible to force vc-dir to use a specific vcs on invocation, or to
change vc-dir's backend after the fact?

If this bugs me enough, I'll take a crack at a workaround/fix.
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18514; Package emacs. (Mon, 22 Sep 2014 00:47:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Barry Warsaw <barry <at> python.org>
Cc: 18514 <at> debbugs.gnu.org
Subject: Re: bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
Date: Sun, 21 Sep 2014 20:46:12 -0400
> Is it possible to force vc-dir to use a specific vcs on invocation, or to
> change vc-dir's backend after the fact?

You can change vc-handled-backends whenever you feel like it.  But I'm
not sure what would be a good hook to do it at the right time.

You can change VC backend after the fact via `vc-switch-backend',
although it was not written with vc-dir in mind, so I'm not sure it'll
work for that case.

> If this bugs me enough, I'll take a crack at a workaround/fix.

The core of the problem is that currently, every backend is responsible
for doing its own "walk up the parent directories" since some backends do
that and others don't.  Back in the days of SVN, such walks did not
exist at all, but nowadays they're "the normal case".

If you look at vc-default-registered, you'll see what was considered
"normal" many years ago.  Nowadays 99.9% of Emacs users have no clue
what those master-templates might be for.

So we need to change vc-registered (and the associated `registered'
backend functions) so that it does the walk up the parent directories,
and then calls each backend, yet also let the backend "refuse" to do
this walk (in case of RCS or SCCS).


        Stefan




Forcibly Merged 3807 8179 8603 18514 42966. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 16 Oct 2020 15:32:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 26 Oct 2020 20:13:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 42966 <at> debbugs.gnu.org and sds <at> gnu.org Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 26 Oct 2020 20:13:03 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 3807 <at> debbugs.gnu.org and Helmut Eller <eller.helmut <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 26 Oct 2020 20:15:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 24 Nov 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 153 days ago.

Previous Next


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