Skip to content

Commit 418d3d3

Browse files
author
Lluís Vilanova
committed
magit-stgit-edit: Add function
1 parent 0a39308 commit 418d3d3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

magit-stgit.el

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ Else, asks the user for a patch name."
249249
;;
250250
(?N "New" magit-stgit-new-popup)
251251
(?n "Rename" magit-stgit-rename)
252+
(?e "Edit" magit-stgit-edit-popup)
252253
(?c "Commit" magit-stgit-commit-popup)
253254
(?C "Uncommit" magit-stgit-uncommit-popup)
254255
(?k "Delete" magit-stgit-delete-popup)
@@ -298,6 +299,22 @@ Use ARGS to pass additional arguments."
298299
(interactive (magit-stgit-new-arguments))
299300
(magit-run-stgit-async "new" args))
300301

302+
(magit-define-popup magit-stgit-edit-popup
303+
"Popup console for StGit edit."
304+
'magit-popups
305+
:switches '((?s "Add \"Signed-off-by:\" line" "--sign")
306+
(?a "Add \"Acked-by:\" line" "--ack"))
307+
:actions '((?e "Edit" magit-stgit-edit))
308+
:default-action #'magit-stgit-edit)
309+
310+
;;;###autoload
311+
(defun magit-stgit-edit (patch &rest args)
312+
"Edit the description of an existing StGit PATCH.
313+
Use ARGS to pass additional arguments."
314+
(interactive (list (magit-stgit-read-patches nil nil t nil "Edit patch (default is top)")
315+
(magit-stgit-edit-arguments)))
316+
(magit-run-stgit-async "edit" "--edit" args "--" patch))
317+
301318
(magit-define-popup magit-stgit-float-popup
302319
"Popup console for StGit float."
303320
'magit-popups
@@ -547,6 +564,8 @@ Use ARGS to pass additional arguments."
547564
:help "Create a new StGit patch"]
548565
["Rename patch" magit-stgit-rename
549566
:help "Rename a patch"]
567+
["Edit patch" magit-stgit-edit-popup
568+
:help "Edit a patch"]
550569
["Commit patch" magit-stgit-commit-popup
551570
:help "Permanently store the base patch into the stack base"]
552571
["Uncommit patch" magit-stgit-uncommit-popup

0 commit comments

Comments
 (0)