From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#42966: 28.0.50; vc-dir: wrong backend Date: Fri, 16 Oct 2020 10:55:54 +0200 Message-ID: <87d01imtwl.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27944"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42966@debbugs.gnu.org To: Sam Steingold Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 16 10:57:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTLXz-00072w-96 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 10:57:11 +0200 Original-Received: from localhost ([::1]:44998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTLXy-0003WL-C2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 04:57:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTLXq-0003UF-KQ for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTLXq-0000r2-AR for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTLXq-000269-95 for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Oct 2020 08:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42966 X-GNU-PR-Package: emacs Original-Received: via spool by 42966-submit@debbugs.gnu.org id=B42966.16028385818013 (code B ref 42966); Fri, 16 Oct 2020 08:57:02 +0000 Original-Received: (at 42966) by debbugs.gnu.org; 16 Oct 2020 08:56:21 +0000 Original-Received: from localhost ([127.0.0.1]:57652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTLXA-00025A-Il for submit@debbugs.gnu.org; Fri, 16 Oct 2020 04:56:21 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:52956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTLX3-00024q-3V for 42966@debbugs.gnu.org; Fri, 16 Oct 2020 04:56:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LrYXdSetvVeoFM3QqeX2XW9ZyPfAZcxrTnq42puXy5E=; b=o9DjDDes3y1/k6q/maaVhHrD91 j0mkifNrnLLELcWbdUZmuM5OAm56Gb4Ohfdn+Yc+7h4w3l3B7F8RphTts9GML7Zn60QJnb6+h3skm Nok6NnmO2uC2dWOshSinVgOigrwls9/y5+67my/WPsz2WVRZzrh3JnL4ETgFqA/MYN84=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTLWl-0000ur-Vq; Fri, 16 Oct 2020 10:56:06 +0200 X-Now-Playing: ELP's _Tarkus_: "A Time And A Place" In-Reply-To: (Sam Steingold's message of "Fri, 21 Aug 2020 11:15:11 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190673 Archived-At: Sam Steingold 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@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