diff options
-rw-r--r-- | init.el | 5 | ||||
-rw-r--r-- | lisp/km-magit.el | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -1005,6 +1005,8 @@ (transient-suffix-put 'magit-push "u" :key "U") (transient-suffix-put 'magit-push "p" :key "P") + (transient-suffix-put 'magit-merge "p" :key "P") + (setf (alist-get 'magit-show-refs transient-values) (list "--sort=-committerdate")) @@ -1152,6 +1154,9 @@ (transient-append-suffix 'magit-merge "m" '("u" "Merge upstream" km/magit-ff-merge-upstream)) + (transient-append-suffix 'magit-merge "u" + '("p" "Merge push" km/magit-ff-merge-push)) + (transient-append-suffix 'magit-branch "b" '("c" "Create & checkout from current" km/magit-branch-and-checkout-from-current)) diff --git a/lisp/km-magit.el b/lisp/km-magit.el index e672ec8..b16c49b 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -125,6 +125,14 @@ branch." (magit-merge-plain it '("--ff-only")) (user-error "No upstream branch"))) +(defun km/magit-ff-merge-push () + "Perform a fast-forward merge of the push branch. +\n(git merge --no-edit --ff-only <push>)" + (interactive) + (--if-let (magit-get-push-branch) + (magit-merge-plain it '("--ff-only")) + (user-error "No push branch"))) + ;;;###autoload (defun km/magit-merge-pull-message (rev) "Generate a PR merge message for REV. |