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

From: Ashwin Kafle <[email-masked]>
Date: Sun, 26 Dec 2021 16:12:13 +0000

Dmitry Gutov <[email-masked]> writes:

> On 26.12.2021 18:51, Ashwin Kafle wrote:
>> Dmitry Gutov<[email-masked]>  writes:
>> 
>>> On 26.12.2021 17:23, Ashwin Kafle wrote:
>>>> Say you use the current vc-delete-file and then immediately restore it
>>>> from backup (before commiting).  VC will show the file as unregistered.
>>>> I think this behavior of vc should be fixed instead.
>>> What would you have it do instead?
>> I think a better way would be to show two files in vc-dir one saying
>> unregistered and one saying deleted.  You mark the one saying deleted
>> then commit that fileset which will not be present after being commited.
>
> All right.
>
> Well, it seems like it will add more cognitive load in the "common"
> scenario -- where you end up deleting the file you said you want to
> delete.
>
> And it will be a breaking change in the existing behavior/UI.

If you delete from disk it behaves exactly like how it's doing right
now.  The only difference should be when you delete and immediately
restore from backup and in that case, only vc-dir shows one extra file.
I don't think it brakes any existing behavior.

>
>> That mechanism can also be used for git add -p as you can show staged
>> file and unsatged file separately.
>
> Perhaps it we added a different UI for staging and committing from
> staging area (like in Magit), it could both be presented better and
> avoid bothering the existing users who like the simpler workflow.

Yeah, it's probably a bit tricky for partial adds but for complete file
deletions it should be no different at all.