Skip to content

Commit 30422dd

Browse files
author
Lluís Vilanova
committed
magit-stgit-goto: Add popup
1 parent 85dda97 commit 30422dd

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

magit-stgit.el

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Else, asks the user for a patch name."
258258
(?s "Sink" magit-stgit-sink-popup)
259259
;;
260260
(?\r "Show" magit-stgit-show)
261-
(?a "Goto" magit-stgit-goto)
261+
(?a "Goto" magit-stgit-goto-popup)
262262
;;
263263
(?g "Refresh" magit-stgit-refresh)
264264
(?r "Repair" magit-stgit-repair)
@@ -448,11 +448,21 @@ Use ARGS to pass additional arguments."
448448
(mapconcat (lambda (patch) (format "`%s'" patch)) patches ", "))))
449449
(magit-run-stgit-and-mark-remove patches "delete" args "--" patches))))
450450

451+
(magit-define-popup magit-stgit-goto-popup
452+
"Popup console for StGit goto."
453+
'magit-popups
454+
:switches '((?k "Keep the local changes" "--keep")
455+
(?m "Check for patches merged upstream" "--merged"))
456+
:actions '((?a "Goto" magit-stgit-goto))
457+
:default-action #'magit-stgit-goto)
458+
451459
;;;###autoload
452-
(defun magit-stgit-goto (patch)
453-
"Set PATCH as target of StGit push and pop operations."
454-
(interactive (magit-stgit-read-patches nil nil t "Goto patch"))
455-
(magit-run-stgit "goto" patch))
460+
(defun magit-stgit-goto (patch &rest args)
461+
"Set PATCH as target of StGit push and pop operations.
462+
Use ARGS to pass additional arguments."
463+
(interactive (list (magit-stgit-read-patches nil nil t "Goto patch")
464+
(magit-stgit-goto-arguments)))
465+
(magit-run-stgit "goto" patch args))
456466

457467
;;;###autoload
458468
(defun magit-stgit-show (patch)

0 commit comments

Comments
 (0)