]> git.eshelyaron.com Git - emacs.git/commit
'C-x v v' on a diff buffer commits it as a patch (bug#52349)
authorJuri Linkov <juri@linkov.net>
Sun, 28 Aug 2022 19:38:51 +0000 (22:38 +0300)
committerJuri Linkov <juri@linkov.net>
Sun, 28 Aug 2022 19:38:51 +0000 (22:38 +0300)
commit4803fba487d41f0817feab48b5095ef4b4940ff6
tree9d8ec174acd273501f163a4664fb250e36c4f267
parent35af917f187719fecadde278a51fd10bf47eed07
'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.
etc/NEWS
lisp/vc/diff-mode.el
lisp/vc/log-edit.el
lisp/vc/vc-dispatcher.el
lisp/vc/vc-git.el
lisp/vc/vc.el