From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards Date: Fri, 27 Aug 2021 09:05:31 +0300 Message-ID: <87y28nbky4.fsf@linkov.net> References: <83h802g77h.fsf@gnu.org> <8f427281-510c-30c3-995f-364e22d9c1e2@yandex.ru> <85y2texxso.fsf@gmail.com> <52f47a82-b93e-d9c2-ee94-752b289d4b96@yandex.ru> <85lfp7ygk3.fsf@gmail.com> <87pmxwgcps.fsf@gnus.org> <1cb67253-c43f-caac-ee83-1241edaaeeaa@yandex.ru> <87k0lildtq.fsf@gnus.org> <6e6060f9-0259-9b12-f925-a1a85c6757c4@yandex.ru> <877dgoutmz.fsf@gnus.org> <2602aeaf-0f02-e744-2b4f-012e73e012e8@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40355"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , Noam Postavsky , 39452@debbugs.gnu.org, Wolfgang.Scherer@gmx.de To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 27 08:24:12 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 1mJVHe-000AFX-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 08:24:10 +0200 Original-Received: from localhost ([::1]:49264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJVHd-0006mH-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 02:24:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJVHW-0006jb-6d for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJVHV-0001XX-UB for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJVHV-00043P-Ol for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 02:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Aug 2021 06:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39452-submit@debbugs.gnu.org id=B39452.163004541915524 (code B ref 39452); Fri, 27 Aug 2021 06:24:01 +0000 Original-Received: (at 39452) by debbugs.gnu.org; 27 Aug 2021 06:23:39 +0000 Original-Received: from localhost ([127.0.0.1]:51083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVH9-00042I-F4 for submit@debbugs.gnu.org; Fri, 27 Aug 2021 02:23:39 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:51525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVH6-00041z-Mo for 39452@debbugs.gnu.org; Fri, 27 Aug 2021 02:23:37 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 2B51CC0008; Fri, 27 Aug 2021 06:23:27 +0000 (UTC) In-Reply-To: <2602aeaf-0f02-e744-2b4f-012e73e012e8@yandex.ru> (Dmitry Gutov's message of "Sun, 15 Aug 2021 04:25:20 +0300") 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:212795 Archived-At: >> If we've seen one piece of code break here already, then perhaps >> reverting and moving to the other (safer, but more invasive) approach is >> the right way to go. > > Fair enough. > > Pushed the other patch with a couple of small tweaks. This broke vc-rename-file that now fails with (error Failed (status 128): git --no-pager mv -f -- :(literal)/tmp/gitrepo/subdir/file1 :(literal)/tmp/gitrepo/subdir/file2) fatal: bad source, source=subdir/:(literal)/tmp/gitrepo/subdir/file1, destination=subdir/:(literal)/tmp/gitrepo/subdir/file2 Can be fixed with diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 02ca022ad4..88e015fc9d 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1559,7 +1559,7 @@ vc-git-delete-file (vc-git-command nil 0 (vc-git--literal-pathspecs file) "rm" "-f" "--")) (defun vc-git-rename-file (old new) - (vc-git-command nil 0 (vc-git--literal-pathspecs (list old new)) "mv" "-f" "--")) + (vc-git-command nil 0 (list old new) "mv" "-f" "--")) (defun vc-git-mark-resolved (files) (vc-git-command nil 0 (vc-git--literal-pathspecs files) "add"))