From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards Date: Fri, 27 Aug 2021 15:51:51 +0300 Message-ID: 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> <87y28nbky4.fsf@linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23269"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: Lars Ingebrigtsen , Noam Postavsky , 39452@debbugs.gnu.org, Wolfgang.Scherer@gmx.de To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 27 14:53: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 1mJbM8-0005qd-19 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 14:53:12 +0200 Original-Received: from localhost ([::1]:55366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJbM5-0000L2-Sb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Aug 2021 08:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJbLy-0000Kr-PP for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 08:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJbLy-0003h7-Hm for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 08:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJbLy-0007Vj-3r for bug-gnu-emacs@gnu.org; Fri, 27 Aug 2021 08:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Aug 2021 12:53:02 +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.163006872528798 (code B ref 39452); Fri, 27 Aug 2021 12:53:02 +0000 Original-Received: (at 39452) by debbugs.gnu.org; 27 Aug 2021 12:52:05 +0000 Original-Received: from localhost ([127.0.0.1]:51428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJbL2-0007UQ-NQ for submit@debbugs.gnu.org; Fri, 27 Aug 2021 08:52:04 -0400 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:40902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJbKy-0007Tt-G2 for 39452@debbugs.gnu.org; Fri, 27 Aug 2021 08:52:03 -0400 Original-Received: by mail-wm1-f50.google.com with SMTP id x2-20020a1c7c02000000b002e6f1f69a1eso9140970wmc.5 for <39452@debbugs.gnu.org>; Fri, 27 Aug 2021 05:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Z26Siy+itJ9zfZF0SlOyTV7tYN2ghUvocdRs0/1JcnA=; b=VEkcK8nnGl+1BcIV9h1ONlyjQrOs5tGjGDr2cjkubhNFB/sCPKlMN6k6TW9UjSjTLk spzlXyV9OXgS5lTKOfMfQphO96BMr+/rcXG03dsUAlJUyZY7AXQnslSKd4QFRuVpJB1G jy5uPtnQLV8GVAmE+4gMYFcLPruEVwcJTPwF+UKREFyJQPoQf49uObyt4ZK86LUTatv0 lPO6jWgcyWAbB+ozs3UVJLZu1H2zD71DFH2jWciHalxIFoONa7uR0K1azsDquhmYzrc0 BPvq+nj4swf/fFwV15NzOgIhA2larZimUpmu5g5uz3PJALnYj/emmCMMG1/tHGpu04fN i3UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z26Siy+itJ9zfZF0SlOyTV7tYN2ghUvocdRs0/1JcnA=; b=V00bbZfRV+D1S8XnmBQedJWtb7krtuaerqDVL1JThhcQBdAy/dH0Fxyfa8zkM9WlpV +opSKrBt8P98ZOk3TT9/m61xdNVgGdPYOgPCjy0hl+QLPDT2B+wKeKYBKpcDrFI7tsn5 Zkvee2nP30QnF8lO10auUu1vRkT1jF6rusWw8rvsbjdkOnC6BYlyFLeqrVujIdCZPKpN MATm6vgRV92hgtRiD4+WKpDCM6ENM/rlo3ZN6c48MTi76mhb6m/5kHjZePSSxl2YHXD/ G9xs4O8eQWf1g+z7F/wQi63495A+gi99047OQXXP2N4jbS5CQyIqu0NawFf/RlxXO3yl hXsw== X-Gm-Message-State: AOAM531MvXKtAo19hMAFT29Vufr4junE4ed9+psDQq/bCkTjztHfvlL+ Jq6OPltiugR3EBK4L7VSYKg= X-Google-Smtp-Source: ABdhPJxCxohHYXdy/+Y5r908svPiZvM2neazjnpGgfW3PmZRi4+3OaI2hKDtsjtVSz3cLhukTDWUqg== X-Received: by 2002:a7b:c048:: with SMTP id u8mr8763394wmc.113.1630068714402; Fri, 27 Aug 2021 05:51:54 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id o8sm10021131wmq.21.2021.08.27.05.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Aug 2021 05:51:53 -0700 (PDT) In-Reply-To: <87y28nbky4.fsf@linkov.net> Content-Language: en-US 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:212810 Archived-At: On 27.08.2021 09:05, Juri Linkov wrote: >>> 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 It was probably broken by the original change, no? Just not fixed by any of the subsequent repairs. > 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")) Looks like the proper fix, thanks. Feel free to push it right away, if you like. Would be great to add some test, though. vc-tests.el currently doesn't exercise vc-rename-file at all.