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


View this message in rfc822 format

From: Ashwin Kafle <ashwin <at> ashwink.com.np>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 52507 <at> debbugs.gnu.org, Ashwin Kafle <ashwin <at> ashwink.com.np>
Subject: bug#52507: [PATCH] Option for vc-delete-file to keep file on disk
Date: Thu, 16 Dec 2021 11:26:44 +0000
Dmitry Gutov <dgutov <at> yandex.ru> 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.

>
>> 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).  That will make all vc backends
compatible without any change.

If other backends support deletion only from the index, then they should
do that as it preserves file-modes and such.




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.