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

From: Ashwin Kafle <[email-masked]>
Date: Mon, 27 Dec 2021 04:08:50 +0000

Dmitry Gutov <[email-masked]> writes:
>>> But the file would stay around, right? That would be different.
>> Only if you give vc-delete-file a prefix argument, otherwise it'll
>> be
>> exactly the same.  It will delete even if we use git rm --cached (because
>> it is checked later if the file exists anymore or not)
>
> OK, that seems to make sense. But how would we convey to the user that
> that "removed" (followed by "unregistered") refers to the staging
> area?
>

By mentioning it in the manual or perhaps in the docstring of
vc-delete-file?  It should be intuitive enough once you do it.

> 
> Patch which would implement this in VC-Dir/Git is welcome.

Can you please explain to me briefly how vc-dir gets this info?  I will
try at it but if you don't hear from me in a week then you know what
happened ;-)

On a related note, how do you test patches?  Last time i had to manually
C-M-x each and every function that was changed.  Is there a way to tell
emacs to ignore byte compiled files so as a simple restart will apply
new changes?  Any other way is okay with me too. 

>
> And the next step would be to ensure that such deletions (which keep
> the file on disk) can be committed by vc-next-action.
>

If it shows the two files, then you can mark the one saying removed and
vc-next-action can commit it.