summaryrefslogtreecommitdiff
path: root/lisp/init-git.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-12-01 22:39:07 -0500
committerKyle Meyer <kyle@kyleam.com>2014-12-01 22:39:07 -0500
commit87a2c26d425f83cc053aaa4b46fb15a88bd9d6ce (patch)
tree5ef034443267f4c0e9fbc3a7b80a34bedb30f8ca /lisp/init-git.el
parent693aa551f5741b8190350629f818770c60fdc5cb (diff)
downloademacs.d-87a2c26d425f83cc053aaa4b46fb15a88bd9d6ce.tar.gz
Add command magit-ff-merge-upstream
Diffstat (limited to 'lisp/init-git.el')
-rw-r--r--lisp/init-git.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/init-git.el b/lisp/init-git.el
index a166c60..f50237e 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -48,6 +48,14 @@ function for calling from outside Magit buffers."
(interactive)
(magit-commit-extend '("--all")))
+(defun km/magit-ff-merge-upstream ()
+ "Perform fast-forward merge of upstream branch.
+\n(git merge --no-edit --ff-only <upstream>)"
+ (interactive)
+ (--if-let (magit-get-tracked-branch)
+ (magit-merge it '("--ff-only"))
+ (user-error "No upstream branch")))
+
(defun km/magit-stage-file-intent (file)
"Stage FILE but not its content.
With a prefix argument or when there is no file at point ask for
@@ -158,6 +166,8 @@ START-POINT set to the current branch.
?a "Push all" 'km/magit-push-all)
(magit-define-popup-action 'magit-push-popup
?h "Push HEAD" 'km/magit-push-head)
+ (magit-define-popup-action 'magit-merge-popup
+ ?u "Merge upstream" 'km/magit-ff-merge-upstream)
(magit-define-popup-action 'magit-log-popup
?a "All branches" 'km/magit-log-all-branches)
(magit-define-popup-action 'magit-branch-popup