GNU bug report logs - #39452
[PATCH] vc-git-state fails for filenames with wildcards

Previous Next

Package: emacs;

Reported by: Wolfgang Scherer <Wolfgang.Scherer <at> gmx.de>

Date: Thu, 6 Feb 2020 14:00:02 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Noam Postavsky <npostavs <at> gmail.com>, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer <at> gmx.de
Subject: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
Date: Fri, 27 Aug 2021 15:51:51 +0300
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.




This bug report was last modified 3 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.