summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2022-08-28 22:38:51 +0300
committerJuri Linkov <juri@linkov.net>2022-08-28 22:38:51 +0300
commit4803fba487d41f0817feab48b5095ef4b4940ff6 (patch)
tree9d8ec174acd273501f163a4664fb250e36c4f267 /etc
parent35af917f187719fecadde278a51fd10bf47eed07 (diff)
downloademacs-4803fba487d41f0817feab48b5095ef4b4940ff6.tar.gz
'C-x v v' on a diff buffer commits it as a patch (bug#52349)
* lisp/vc/diff-mode.el (diff-vc-deduce-fileset): New function. * lisp/vc/log-edit.el (log-edit-diff-patch): New function. * lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function to log-edit-diff-patch when vc-patch-string is non-nil. (vc-start-logentry): New optional arg 'patch-string'. Set buffer-local 'vc-patch-string' to 'patch-string'. (vc-dispatcher-browsing): Add (derived-mode-p 'diff-mode). * lisp/vc/vc-git.el (vc-git-checkin-patch): New function. (vc-git-checkin): When vc-git-patch-string is non-nil, use `git apply --cached` to add the patch to the index, then commit the staged changes. * lisp/vc/vc.el: New backend function 'checkin-patch'. (vc-deduce-fileset-1): Call diff-vc-deduce-fileset in diff-mode. (vc-next-action): For model 'patch' call vc-checkin with the diff buffer string. (vc-checkin): New optional arg 'patch-string'. Call backend function 'checkin-patch' when 'patch-string' is non-nil. Call vc-start-logentry with 'patch-string'. (vc-diff-patch-string): New function.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f337381dd44..b27f0760d12 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1580,6 +1580,12 @@ info node. This command only works for the Emacs and Emacs Lisp manuals.
This command marks files based on a regexp. If given a prefix
argument, unmark instead.
+*** 'C-x v v' on a diff buffer commits it as a patch.
+You can create a diff buffer by e.g. 'C-x v D' ('vc-root-diff'),
+then remove unnecessary hunks, and commit only part of your changes
+by typing 'C-x v v' in that diff buffer. Currently this works only
+with Git.
+
---
*** 'C-x v v' on an unregistered file will now use the most specific backend.
Previously, if you had an SVN-covered "~/" directory, and a Git-covered