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

From: Dmitry Gutov <[email-masked]>
Date: Thu, 16 Dec 2021 14:27:00 +0300

On 16.12.2021 14:26, Ashwin Kafle wrote:
> Dmitry Gutov <[email-masked]> writes:
> 
>> On 16.12.2021 10:12, Ashwin Kafle wrote:
>>> But this would mean that every vc-backend will have to be changed,
>>> immediately.
>>
>> Not really: since the arg is optional, we can make sure to only add it
>> when it's non-nil, and otherwise call the backends with 1 argument.
> 
> But then the user will get error about wrong number of arguments if the
> backend doesn't support it.

That's better than having the file deleted, I think.

And our implementation can catch this particular error and show a more 
humane message, too.

>>
>>> Also, having every vc-backend accept and check keep-on-disk will result
>>> on a lot of duplicate code that can simply be avoided.
>>
>> That's a valid argument, I suppose. Depends on whether many other
>> backends (VCSes) know how to delete files without deleting them on
>> disk.
>>
>> OTOH, it would be handy to let those that don't declare explicitly
>> their inability to do that (by not supporting the second argument).
> 
> I think it would be better to check if the file exists after calling vc
> backends.  If it doesn't and keep-files is non-nil, we can restore from the
> backup(which is always happening).

Couldn't backups be disabled?