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 #25 received at 52507 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Ashwin Kafle <ashwin <at> ashwink.com.np>, 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 01:59:35 +0300
On 15.12.2021 12:53, Ashwin Kafle wrote:
>   (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" "--"))

This changes the semantics of the 'delete-file' backend action. Kind of 
breaking strict compatibility with third-party backends.

I think it would be better to add an optional argument to it instead 
(e.g. call it KEEP-FILE, just like the new arg to vc-delete-file; or 
KEEP-ON-DISK).

Then git's implementation's signature will look like

  (defun vc-git-delete-file (file &optional keep-on-disk)

and it will decide whether to add '--cached' based on that argument.

No 'delete-file' investigation will be needed as a result.




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.