Subject: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks

From: Juri Linkov <[email-masked]>
Date: Tue, 07 Dec 2021 21:04:20 +0200

>> I tried to do what is described in the second part of
>> https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00207.html
>> Is this the same that you request here?
>
> It does look like the same approach. I was only thinking of staging
> specific hunks, while you suggest killing them as well, which would be just
> as useful I guess.
>
> My use-case is the following: I often do different changes to a file (or in
> a project) and it may happen that I have to stage, commit, and push just
> some of them, while keep working on the others. If this matches your
> proposal somehow, then we are saying the same thing indeed.

This is exactly my use case as well: when some parts of the file are not
yet ready to commit, then these hunks can be deleted from the output
of 'C-x v D'.  Then the remaining patch in the *vc-diff* buffer could be
committed after temporarily moving all file changes into the stash.
After committing the selected changes, the stash should be returned back
by using `stash pop`.