`magit-merge' was only called when `magit-rigid-key-bindings' == t
(does anybody even use that?), in which case `magit-manual-merge'
should have been called instead anyway (see commit dbd213ec).

`magit-merge' now defaults to `magit-manual-merge's behavior, but still
allows to skip editing the log message using the optional arg DO-COMMIT.

The new arg is mainly there to support skipping `magit-log-edit'
programmatically though, since humans will most likely be better off
just tapping "C-c C-c" in "*magit-edit-log*" instead of having to think
about it in advance.

Signed-off-by: Pieter Praet <[email protected]>
---
 magit-key-mode.el |  2 +-
 magit.el          | 22 ++++++++--------------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/magit-key-mode.el b/magit-key-mode.el
index 79f8fa2..20dfa2e 100644
--- a/magit-key-mode.el
+++ b/magit-key-mode.el
@@ -147,7 +147,7 @@ (defvar magit-key-mode-groups
     (merging
      (man-page "git-merge")
      (actions
-      ("m" "Merge" magit-manual-merge))
+      ("m" "Merge" magit-merge))
      (switches
       ("-ff" "Fast-forward only" "--ff-only")
       ("-nf" "No fast-forward" "--no-ff")
diff --git a/magit.el b/magit.el
index 032a013..994e430 100644
--- a/magit.el
+++ b/magit.el
@@ -960,7 +960,7 @@ (defvar magit-diffstat-keymap
     ["Snapshot" magit-stash-snapshot t]
     "---"
     ["Branch..." magit-checkout t]
-    ["Merge" magit-manual-merge t]
+    ["Merge" magit-merge t]
     ["Interactive resolve" magit-interactive-resolve-item t]
     ["Rebase" magit-rebase-step t]
     ("Rewrite"
@@ -4567,27 +4567,21 @@ (defun magit-remove-conflicts (alist)
 ;;; Acting (1)
 ;;;; Merging
 
-(magit-define-command manual-merge (revision)
+(defun magit-merge (revision &optional do-commit)
   "Merge REVISION into the current 'HEAD'; leave changes uncommitted.
 \('git merge --no-commit REVISION')."
-  (interactive (list (magit-read-rev "Merge" (magit-guess-branch))))
+  (interactive (list (magit-read-rev "Merge" (magit-guess-branch))
+                     current-prefix-arg))
   (when revision
     (apply 'magit-run-git
-           "merge" "--no-commit"
+           "merge"
            (magit-rev-to-git revision)
-           magit-custom-options)
+           (if do-commit
+               magit-custom-options
+             (cons "--no-commit" magit-custom-options)))
     (when (file-exists-p ".git/MERGE_MSG")
       (magit-log-edit))))
 
-(defun magit-merge (revision)
-  "Merge REVISION into the current 'HEAD'; commit unless merge fails.
-\('git merge REVISION')."
-  (interactive (list (magit-read-rev-with-default "Merge")))
-  (apply 'magit-run-git
-         "merge"
-         (magit-rev-to-git revision)
-         magit-custom-options))
-
 (defun magit-merge-abort ()
   "Abort the current merge operation."
   (interactive)
-- 
1.7.11.1

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to