GNU bug report logs - #3807
23.1.50; vc-dir ignores .gitignore

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Fri, 10 Jul 2009 09:45:04 UTC

Severity: minor

Tags: fixed

Merged with 8179, 8603, 18514, 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 3807 in the body.
You can then email your comments to 3807 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3807; Package emacs. (Fri, 10 Jul 2009 09:45:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 10 Jul 2009 09:45:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; vc-dir ignores .gitignore
Date: Fri, 10 Jul 2009 11:20:20 +0200
I use git to manage some files (.emacs, .bashrc etc.) in my home
directory and hg for a project in a directory named ~/lisp/slime/.
I have both, a ~/.git and a ~/lisp/slime/.hg directory
and my ~/.gitignore contains a line with: lisp* 

However when I invoke C-x v d on ~/lisp/slime, a buffer
pops up with the first (wrong) line:  VC backend : Git
and lists most of the files from the ~/lisp/slime directory
as "unregistered".  Obviously, I would prefer to use the hg backend
for the ~/lisp/slime directory.

On the other hand: if I open a file in ~/lisp/slime the modeline
correctly displays hg and commands like C-x v l or C-x v = correctly 
use the hg backend.

Helmut.


In GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2009-07-10 on ix
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--with-xpm=no' '--with-gif=no' '--with-tiff=no' '--with-sound=no''



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3807; Package emacs. (Fri, 10 Jul 2009 19:40:06 GMT) Full text and rfc822 format available.

Message #8 received at 3807 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 3807 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#3807: 23.1.50; vc-dir ignores .gitignore
Date: Fri, 10 Jul 2009 12:29:55 -0700 (PDT)
Helmut Eller <eller.helmut <at> gmail.com> writes:

  > I use git to manage some files (.emacs, .bashrc etc.) in my home
  > directory and hg for a project in a directory named ~/lisp/slime/.
  > I have both, a ~/.git and a ~/lisp/slime/.hg directory
  > and my ~/.gitignore contains a line with: lisp* 
  > 
  > However when I invoke C-x v d on ~/lisp/slime, a buffer
  > pops up with the first (wrong) line:  VC backend : Git
  > and lists most of the files from the ~/lisp/slime directory
  > as "unregistered".  Obviously, I would prefer to use the hg backend
  > for the ~/lisp/slime directory.
  > 
  > On the other hand: if I open a file in ~/lisp/slime the modeline
  > correctly displays hg and commands like C-x v l or C-x v = correctly 
  > use the hg backend.

What happens here is: vc-dir calls (vc-responsible-backend  "~/lisp/slime"),
 which calls (vc-git-responsible-p "~/lisp/slime")
and that returns t because all vc-git-responsible-p does is to see if
~/lisp/slime is dominated by a .git directory.  And it is.

You can easily work around this by changing the order of git and hg in
vc-handled-backends in your .emacs, like this: 

(setq vc-handled-backends '(RCS CVS SVN SCCS Bzr Hg Git Mtn Arch))

We could make `vc-git-responsible-p' (and all the other functions that
do the same) not return t in this case, but I doubt it's worth the added
extra complexity. 
Stefan, what do you think?



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3807; Package emacs. (Tue, 14 Jul 2009 19:00:03 GMT) Full text and rfc822 format available.

Message #11 received at 3807 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 3807 <at> debbugs.gnu.org
Subject: Re: bug#3807: 23.1.50; vc-dir ignores .gitignore
Date: Tue, 14 Jul 2009 11:54:17 -0700 (PDT)
Helmut Eller <eller.helmut <at> gmail.com> writes:

  > I use git to manage some files (.emacs, .bashrc etc.) in my home
  > directory and hg for a project in a directory named ~/lisp/slime/.
  > I have both, a ~/.git and a ~/lisp/slime/.hg directory
  > and my ~/.gitignore contains a line with: lisp* 
  > 
  > However when I invoke C-x v d on ~/lisp/slime, a buffer
  > pops up with the first (wrong) line:  VC backend : Git
  > and lists most of the files from the ~/lisp/slime directory
  > as "unregistered".  Obviously, I would prefer to use the hg backend
  > for the ~/lisp/slime directory.
  > 
  > On the other hand: if I open a file in ~/lisp/slime the modeline
  > correctly displays hg and commands like C-x v l or C-x v = correctly 
  > use the hg backend.

There's a generic workaround for problems like this: use
C-u C-x v d 
to start vc-dir, it will prompt for the VC backend to use.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3807; Package emacs. (Tue, 14 Jul 2009 21:20:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 14 Jul 2009 21:20:06 GMT) Full text and rfc822 format available.

Message #16 received at 3807 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: 3807 <at> debbugs.gnu.org
Subject: Re: bug#3807: 23.1.50; vc-dir ignores .gitignore
Date: Tue, 14 Jul 2009 23:13:55 +0200
* Dan Nicolaescu [2009-07-14 20:54+0200] writes:

>   > However when I invoke C-x v d on ~/lisp/slime, a buffer
>   > pops up with the first (wrong) line:  VC backend : Git
>   > and lists most of the files from the ~/lisp/slime directory
>   > as "unregistered".  Obviously, I would prefer to use the hg backend
>   > for the ~/lisp/slime directory.
>   > 
>   > On the other hand: if I open a file in ~/lisp/slime the modeline
>   > correctly displays hg and commands like C-x v l or C-x v = correctly 
>   > use the hg backend.
>
> There's a generic workaround for problems like this: use
> C-u C-x v d 
> to start vc-dir, it will prompt for the VC backend to use.

It's kinda inconsistent that vc-find-file-hook and vc-dir choose
different backends, but fair enough, I can live with the prefix arg.

Helmut.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3807; Package emacs. (Wed, 15 Jul 2009 19:10:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 15 Jul 2009 19:10:08 GMT) Full text and rfc822 format available.

Message #21 received at 3807 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dan Nicolaescu <dann <at> ics.uci.edu>
Cc: Helmut Eller <eller.helmut <at> gmail.com>, 3807 <at> debbugs.gnu.org
Subject: Re: bug#3807: 23.1.50; vc-dir ignores .gitignore
Date: Wed, 15 Jul 2009 15:06:39 -0400
> We could make `vc-git-responsible-p' (and all the other functions that
> do the same) not return t in this case, but I doubt it's worth the added
> extra complexity. 
> Stefan, what do you think?

I think that rather than having an external loop for all backends which
inside walks up the diretory hierarchy, we need an external loop which
walks up the directory hierarchy and inside loops over all backends.


        Stefan



Forcibly Merged 3807 8179. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 06 Oct 2011 03:23:01 GMT) Full text and rfc822 format available.

Forcibly Merged 3807 8179 8603. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 07 Oct 2011 07:11:02 GMT) Full text and rfc822 format available.

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:02 GMT) Full text and rfc822 format available.

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:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#3807; Package emacs. (Mon, 26 Oct 2020 20:15:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 3807 <at> debbugs.gnu.org
Date: Mon, 26 Oct 2020 21:14:20 +0100
Helmut Eller <eller.helmut <at> gmail.com> writes:

> I use git to manage some files (.emacs, .bashrc etc.) in my home
> directory and hg for a project in a directory named ~/lisp/slime/.
> I have both, a ~/.git and a ~/lisp/slime/.hg directory
> and my ~/.gitignore contains a line with: lisp* 
>
> However when I invoke C-x v d on ~/lisp/slime, a buffer
> pops up with the first (wrong) line:  VC backend : Git
> and lists most of the files from the ~/lisp/slime directory
> as "unregistered".  Obviously, I would prefer to use the hg backend
> for the ~/lisp/slime directory.

This has now been fixed in Emacs 28 in bug#42966, I think.

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




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 356 days ago.

Previous Next


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