>>> "DG" == Dmitry Gutov writes: > On 19.10.2022 08:40, Uwe Brauer wrote: >> Dmitry, with this approach maybe then even >> hg shelve -i >> would be doable? > I suppose something like this could work for Git and Hg: > 1) Stash/Shelve all current changes. > 2) Apply the provided patch. Somehow deal carefully with the new files > in there, especially when said files are already present (and > unregistered) in the work tree. Probably by scanning the file list in > the patch in advance and 'git add'-ing all the existing new file first > in step 1. > 3) Stash the currently applied new changes. Also don't forget to 'git > add' any unregistered files. > 4) Unstash/unshelve the previous stash. That sounds sensible to me. > And I guess it will require a new key binding in diff-mode buffers. I see. BTW I only realised by now that the fact that a buffer in diff-mode is in read-only mode is not essential but not a required feature. I say this, because sometimes the diff file contains a lot of hunks and I only want to commit 2 of say 20. Then toggling read-only off and just delete the hunks via kill-region, simplify things a lot (instead of killing each hunk separately, using next-hunk and kill-hunk). -- Warning: Content may be disturbing to some audiences I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the ban of Russia from SWIFT. I support the EU membership of the Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/