bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dmitry Gutov
Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Thu, 16 Dec 2021 01:59:35 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]