@@ -262,7 +262,7 @@ one from the minibuffer, and move to the next line."
262
262
[(" c" " Commit" magit-stgit-commit)
263
263
(" C" " Uncommit" magit-stgit-uncommit)
264
264
(" r" " Repair" magit-stgit-repair)
265
- (" R" " Rebase" magit-stgit-rebase-popup )]
265
+ (" R" " Rebase" magit-stgit-rebase)]
266
266
[(" z" " Undo" magit-stgit-undo-popup)
267
267
(" Z" " Redo" magit-stgit-redo-popup)]]
268
268
[" Patch"
@@ -474,28 +474,33 @@ into the series."
474
474
(magit-run-stgit " repair" )
475
475
(message " Repairing series...done " ))
476
476
477
- (magit-define-popup magit-stgit-rebase-popup
478
- " Popup console for StGit rebase."
479
- 'magit-stgit-commands
480
- :switches '((?n " Do not push the patches back after rebasing" " --nopush" )
481
- (?m " Check for patches merged upstream" " --merged" ))
482
- :actions '((?R " Rebase" magit-stgit-rebase))
483
- :default-action #'magit-stgit-rebase )
477
+ (transient-define-prefix magit-stgit-rebase ()
478
+ " Rebase the stack."
479
+ :man-page " stg-rebase"
480
+ [" Arguments"
481
+ (" -n" " Do not push the patches back after rebasing" " --nopush" )
482
+ (" -m" " Check for patches merged upstream" " --merged" )]
483
+ [" Actions"
484
+ (" R" " Rebase" magit-stgit--rebase)])
484
485
485
486
;;;### autoload
486
- (defun magit-stgit-rebase (&rest args )
487
- " Rebase a StGit patch series.
488
- Use ARGS to pass additional arguments"
489
- (interactive (magit-stgit-rebase-arguments))
490
- (let* ((branch (magit-get-current-branch))
491
- (remote (magit-get-remote branch)))
492
- (if (not (and remote branch))
493
- (user-error " Branch has no upstream" )
494
- (when (y-or-n-p " Update remote first? " )
495
- (message " Updating remote... " )
496
- (magit-run-git-async " remote" " update" remote)
497
- (message " Updating remote...done " ))
498
- (magit-run-stgit " rebase" args " --" (format " remotes/%s /%s " remote branch)))))
487
+ (defun magit-stgit--rebase (remote branch &rest args )
488
+ " Invoke `stg rebase ARGS... remotes/REMOTE/BRANCH'.
489
+
490
+ If called interactively, use the current branch and its remote,
491
+ and ask whether to update the remote first."
492
+ (interactive (append (let* ((branch (magit-get-current-branch))
493
+ (remote (magit-get-remote branch)))
494
+ (if (and remote branch)
495
+ (list remote branch)
496
+ (user-error " Branch has no upstream" )))
497
+ (transient-args 'magit-stgit-rebase )))
498
+ (when (and (called-interactively-p 'any )
499
+ (y-or-n-p " Update remote first? " ))
500
+ (message " Updating remote... " )
501
+ (magit-run-git-async " remote" " update" remote)
502
+ (message " Updating remote...done " ))
503
+ (magit-run-stgit " rebase" args (format " remotes/%s /%s " remote branch)))
499
504
500
505
(magit-define-popup magit-stgit-delete-popup
501
506
" Popup console for StGit delete."
@@ -701,7 +706,7 @@ the To, Cc, and Bcc fields for all patches."
701
706
:help " Refresh the contents of a patch in an StGit series" ]
702
707
[" Repair" magit-stgit-repair
703
708
:help " Repair StGit metadata if branch was modified with git commands" ]
704
- [" Rebase series" magit-stgit-rebase-popup
709
+ [" Rebase series" magit-stgit-rebase
705
710
:help " Rebase an StGit patch series" ]
706
711
" ---"
707
712
[" Undo the last operation" magit-stgit-undo-popup
0 commit comments