From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23436: [PATCH] Attemp to use the true name of a file to determine responsible vc if the genuine name does not work. Date: Thu, 20 Oct 2016 11:23:36 +0300 Message-ID: <83pomvtomv.fsf@gnu.org> References: <1462311145-5959-1-git-send-email-hong@topbug.net> <85f11f8a-1799-befd-3e5b-f7d7a6eac660@topbug.net> <072a649f-d11a-7c82-b3ae-32d9a92c8f8b@topbug.net> <5d653522-49bd-8b48-e3d6-0c09d1c65fae@yandex.ru> <837f93v75m.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1476951862 7062 195.159.176.226 (20 Oct 2016 08:24:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2016 08:24:22 +0000 (UTC) Cc: dgutov@yandex.ru, 23436@debbugs.gnu.org To: Hong Xu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 10:24:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8e2-0000La-38 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 10:24:10 +0200 Original-Received: from localhost ([::1]:53133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8e4-0001r8-8O for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2016 04:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8dx-0001qr-8k for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx8dt-0002Ob-TE for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bx8dt-0002OX-Pg for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bx8dt-0002GR-Kp for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2016 04:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2016 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23436 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23436-submit@debbugs.gnu.org id=B23436.14769518398696 (code B ref 23436); Thu, 20 Oct 2016 08:24:01 +0000 Original-Received: (at 23436) by debbugs.gnu.org; 20 Oct 2016 08:23:59 +0000 Original-Received: from localhost ([127.0.0.1]:40322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8dr-0002GC-He for submit@debbugs.gnu.org; Thu, 20 Oct 2016 04:23:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bx8dq-0002Fz-AE for 23436@debbugs.gnu.org; Thu, 20 Oct 2016 04:23:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx8dh-0002Kp-T5 for 23436@debbugs.gnu.org; Thu, 20 Oct 2016 04:23:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8dh-0002Kh-Pr; Thu, 20 Oct 2016 04:23:49 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4769 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bx8dg-0000dq-N6; Thu, 20 Oct 2016 04:23:49 -0400 In-reply-to: (message from Hong Xu on Thu, 20 Oct 2016 00:21:31 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124720 Archived-At: > Cc: dgutov@yandex.ru, 23436@debbugs.gnu.org > From: Hong Xu > Date: Thu, 20 Oct 2016 00:21:31 -0700 > > On 10/19/2016 11:58 PM, Eli Zaretskii wrote: > >> From: Hong Xu > >> Date: Wed, 19 Oct 2016 17:16:58 -0700 > >> > >>>>>> + (dolist (file-path (list file (file-truename file))) > >>>>> > >>>>> Why not just use the true name? > >>>> > >>>> Because sometimes we track symlinks specifically. The symlink files may > >>>> link to a file in a different repo, for example a git submodule. > >>> > >>> I'm not sure I understand. Please outline a problem scenario. > >> > >> mkdir my-repo && cd my-repo > >> hg init > >> git clone git://git.savannah.gnu.org/emacs.git > >> ln -s emacs/README README_emacs > >> hg add README_emacs > >> > >> README_emacs is tracked in the repo "my-repo" but README is tracked in > >> the emacs repo. If true name is directly used, we would fail to obtain > >> the correct responsible backend. > > > > What is the correct backend in this case? You seem to assume it's the > > one that maintains the symlink, but why is that assumption true? > > > > The backend is determined for certain operations. Did you make sure > > all of them will indeed want the backend of my-repo and not the other > > one. > > I agree that this assumption is quite controversial even for myself -- > it depends on what this function is used for. Adding an option may be > the best way to resolve it. What bothers me is that the use case where there really is no backend will now take twice as much time as it did before. Can we avoid trying the 2nd search by detecting that the truename and the original name specify the same file? Or maybe by detecting the file types that could justify the second search in the first place?