Skip to content

Commit c1de942

Browse files
author
Lluís Vilanova
committed
magit-stgit-rebase: Add popup
1 parent b316dca commit c1de942

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

magit-stgit.el

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Else, asks the user for a patch name."
261261
;;
262262
(?g "Refresh" magit-stgit-refresh-popup)
263263
(?r "Repair" magit-stgit-repair)
264-
(?R "Rebase" magit-stgit-rebase)
264+
(?R "Rebase" magit-stgit-rebase-popup)
265265
;;
266266
(?z "Undo" magit-stgit-undo-popup)
267267
(?Z "Redo" magit-stgit-redo-popup)))
@@ -404,10 +404,19 @@ into the series."
404404
(magit-run-stgit "repair")
405405
(message "Repairing series...done"))
406406

407+
(magit-define-popup magit-stgit-rebase-popup
408+
"Popup console for StGit rebase."
409+
'magit-popups
410+
:switches '((?n "Do not push the patches back after rebasing" "--nopush")
411+
(?m "Check for patches merged upstream" "--merged"))
412+
:actions '((?R "Rebase" magit-stgit-rebase))
413+
:default-action #'magit-stgit-rebase)
414+
407415
;;;###autoload
408-
(defun magit-stgit-rebase ()
409-
"Rebase a StGit patch series."
410-
(interactive)
416+
(defun magit-stgit-rebase (&rest args)
417+
"Rebase a StGit patch series.
418+
Use ARGS to pass additional arguments"
419+
(interactive (magit-stgit-rebase-arguments))
411420
(let* ((branch (magit-get-current-branch))
412421
(remote (magit-get-remote branch)))
413422
(if (not (and remote branch))
@@ -416,7 +425,7 @@ into the series."
416425
(message "Updating remote...")
417426
(magit-run-git-async "remote" "update" remote)
418427
(message "Updating remote...done"))
419-
(magit-run-stgit "rebase" (format "remotes/%s/%s" remote branch)))))
428+
(magit-run-stgit "rebase" args "--" (format "remotes/%s/%s" remote branch)))))
420429

421430
(magit-define-popup magit-stgit-delete-popup
422431
"Popup console for StGit delete."

0 commit comments

Comments
 (0)