GNU bug report logs - #52507
[PATCH] Option for vc-delete-file to keep file on disk

Previous Next

Package: emacs;

Reported by: Ashwin Kafle <ashwin <at> ashwink.com.np>

Date: Wed, 15 Dec 2021 12:56:02 UTC

Severity: normal

Merged with 52508

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


Message #43 received at 52507 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ashwin Kafle <ashwin <at> ashwink.com.np>
Cc: 52507 <at> debbugs.gnu.org
Subject: Re: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Thu, 16 Dec 2021 19:01:20 +0200
>>>  (defun vc-git-delete-file (file)
>>> -  (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--"))
>>> +  (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--cached" "--")))
>>>
>>> because it deletes the file in the staging area
>>> that is not used by vc-git, so there is no way
>>> to commit the deletion using vc commands.
>> ...
> Oh, you mean just that single commit can't be done by vc now.  Yeah,
> that seems true. Can you think of any solution for that here?

--cached can't be used anyway, because vc commands doesn't use the git index.
Currently, after vc-delete-file, we have the following status in vc-dir:

                         ./
     removed             file1
     unregistered        file1~

So the user can commit the removed file with vc-next-action.
Then after this, the user can manually rename the unregistered backup
by removing ~ from the file name.

So it seems that you want to automate the last part, i.e.
to try automatically rename the file from its backup copy
after all changes were committed?




This bug report was last modified 166 days ago.

Previous Next


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