Subject: Re: bug#20558: 24.4; vc-revert on deleted file (git and svn should be more consistent)

From: Dmitry Gutov <[email-masked]>
Date: Wed, 25 Nov 2015 04:42:25 +0200

On 05/12/2015 06:13 PM, Ed Avis wrote:

> If the file no longer exists on disk, then I suggest vc-revert
> should act as follows:
>
> - If the buffer is marked as modified, offer to save it, and after
>    saving show diffs and prompt to revert as usual.

I believe we already do that. And if the user says no, the whole 
operation is aborted.

> - If the buffer is not marked as modified, a diff should still be shown
>    between the current buffer contents and what would be fetched from the
>    version control system to replace it.

That sounds a bit inconvenient to implement, and I guess I don't see a 
lot of benefit.

>  If that diff is empty, then
>    just go ahead and revert.

That goes against the main use case of vc-revert, as I see it: 
discarding uncommitted changes if you no longer want them.

> Or alternatively, vc-revert should just automatically save-buffer first
> if the underlying file no longer exists on disk.

That's doable. But then we'll also need to delete it afterwards if the 
user says no.