From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#50572: 28.0.50; [PATCH] fix VC to find the responsible backend with the most specific path. Date: Fri, 12 Nov 2021 17:20:31 +0200 Message-ID: <83y25txuww.fsf@gnu.org> References: <877dfkxyt4.fsf@elite.giraud> <87cznef8ah.fsf@gnus.org> <86ilx5iaze.fsf@gmail.com> <87pmrdb0zv.fsf@gnus.org> <86mtmgx6gg.fsf@gmail.com> <87fe707b-f2b4-febd-d2ae-acc697b4cee1@yandex.ru> <87zgqgjeaz.fsf@gnus.org> <87cznbt2r1.fsf@elite.giraud> <87h7cn803w.fsf@gnus.org> <878rxzszl8.fsf@elite.giraud> <877ddiuhv7.fsf@gnus.org> <87y25x3e6g.fsf@elite.giraud> <87a6icoqkm.fsf@gnus.org> <87k0hditw7.fsf@elite.giraud> <83a6i9ziiq.fsf@gnu.org> <87fss1quka.fsf@elite.giraud> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25190"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50572@debbugs.gnu.org, larsi@gnus.org, andrewjmoreton@gmail.com, dgutov@yandex.ru To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 12 16:21:17 2021 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 1mlYMe-0006LR-He for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 16:21:16 +0100 Original-Received: from localhost ([::1]:41792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlYMd-00022m-EM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 10:21:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlYMR-0001xu-D1 for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 10:21:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlYMQ-00009F-6g for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 10:21:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlYMQ-0005T9-2k for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 10:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Nov 2021 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 50572-submit@debbugs.gnu.org id=B50572.163673045820992 (code B ref 50572); Fri, 12 Nov 2021 15:21:02 +0000 Original-Received: (at 50572) by debbugs.gnu.org; 12 Nov 2021 15:20:58 +0000 Original-Received: from localhost ([127.0.0.1]:45762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlYMM-0005SV-3Y for submit@debbugs.gnu.org; Fri, 12 Nov 2021 10:20:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlYMK-0005SI-L8 for 50572@debbugs.gnu.org; Fri, 12 Nov 2021 10:20:57 -0500 Original-Received: from [2001:470:142:3::e] (port=45754 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlYME-00008Q-D3; Fri, 12 Nov 2021 10:20:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PJrF5u1FzI3TRTHdX34klgtK5Dg7P1lS8Dza/SJhIi0=; b=TE9OypISe/nr c0+TB2mrdpT+2nQV+Bn+EuCd1216TGlrytlZ0zzADqXlRUs42FCeMqa4dE+kZYSgMRNXSZno4FTiR /LwPPEmIrUfQQ7CDhDOxxw2L+mnSazjT4R6D6Yksm4RWoibPaxLhg+hsMvJbfbI7KpvXoXtVyqcJQ BsXz33MKDDXY2A5MjuJ1PY0hKWoMgPQ1C8DCIyuRi0GJlTXhMPXe2EykCMpOzGnV4BQU2zA561GoO 6pb3dyh2Nbe+nCl6pDeyyTMqvina9SDaozu9sRyOciHDJFYR4+SDit+NvyGD/fsH13AyDQGXsSm03 ctoK0OcXKAMt4Rc0S3hxxg==; Original-Received: from [87.69.77.57] (port=4079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlYME-0007H2-0H; Fri, 12 Nov 2021 10:20:50 -0500 In-Reply-To: <87fss1quka.fsf@elite.giraud> (message from Manuel Giraud on Fri, 12 Nov 2021 16:09:57 +0100) 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:219776 Archived-At: > From: Manuel Giraud > Cc: 50572@debbugs.gnu.org, larsi@gnus.org, andrewjmoreton@gmail.com, > dgutov@yandex.ru > Date: Fri, 12 Nov 2021 16:09:57 +0100 > > Eli Zaretskii writes: > > > Please don't use "path" for anything that is not PATH-style directory > > lists. > > Ok but I have hard time figuring out what would be a correct name here > because (vc-call-backend backend 'responsible-p file) returns a path (or > nil) if the backend is responsible. Does "path-string" will do? Either "file-name" or "dir-name", or something along those lines, should do, I think. We are talking about variable names, yes? > > Also, shouldn't the file name(s) be run through expand-file-name, to > > make sure they are absolute? Otherwise comparing the length will not > > DTRT. > > Ok, I'll do this but I'll also need a new name here (in case of a nil > returned by vc-call-backend): "expanded-path-string" ? Maybe I'm missing something, but why not test the value for being a string, and only call expand-file-name if it is?