all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
@ 2014-09-20 22:41 Barry A. Warsaw
  2014-09-21 21:28 ` Glenn Morris
  2014-09-21 21:48 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Barry A. Warsaw @ 2014-09-20 22:41 UTC (permalink / raw)
  To: 18514


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)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
  2014-09-20 22:41 bug#18514: 24.3; vc-dir sometimes guesses the wrong backend Barry A. Warsaw
@ 2014-09-21 21:28 ` Glenn Morris
  2014-09-21 21:48 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2014-09-21 21:28 UTC (permalink / raw)
  To: Barry A. Warsaw; +Cc: 18514

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.)






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
  2014-09-20 22:41 bug#18514: 24.3; vc-dir sometimes guesses the wrong backend Barry A. Warsaw
  2014-09-21 21:28 ` Glenn Morris
@ 2014-09-21 21:48 ` Stefan Monnier
  2014-09-21 22:00   ` Barry Warsaw
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-09-21 21:48 UTC (permalink / raw)
  To: Barry A. Warsaw; +Cc: 18514

> $ 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
  2014-09-21 21:48 ` Stefan Monnier
@ 2014-09-21 22:00   ` Barry Warsaw
  2014-09-22  0:46     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Barry Warsaw @ 2014-09-21 22:00 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 18514

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18514: 24.3; vc-dir sometimes guesses the wrong backend
  2014-09-21 22:00   ` Barry Warsaw
@ 2014-09-22  0:46     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-09-22  0:46 UTC (permalink / raw)
  To: Barry Warsaw; +Cc: 18514

> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-22  0:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20 22:41 bug#18514: 24.3; vc-dir sometimes guesses the wrong backend Barry A. Warsaw
2014-09-21 21:28 ` Glenn Morris
2014-09-21 21:48 ` Stefan Monnier
2014-09-21 22:00   ` Barry Warsaw
2014-09-22  0:46     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.