tags:

views:

51

answers:

1

I can’t seem to get my merges intact with Magit for Emacs without squashing them into the current branch consistently. Sometimes a new commit object is created after the merge (which is what I want), sometimes commits are squashed.

I basically just want to do 'git merge --no-ff topicbranch' in Magit.

So how do I enforce the --no-ff flag/create new object rule with Magit?

+1  A: 

Maybe because that patch has be included in the current Magit?

(defun magit-manual-merge (rev)
-  (interactive (list (magit-read-rev "Manually merge" (magit-guess-branch))))
+  (interactive (list (magit-read-rev (concat "Manually merge"
+                                             (if current-prefix-arg " (squashed)" ""))
+                                     (magit-guess-branch))))
   (if rev
-      (magit-run-git "merge" "--no-ff" "--no-commit"
+      (magit-run-git "merge" "--no-commit" (if current-prefix-arg "--squash" "--no-ff")
             (magit-rev-to-git rev))))

If you would like to squash the merge (have git avoid creating a merge commit) then use a prefix argument with the command (@kbd{C-U m})

Are you using a prefix argument?

VonC
Nope I haven't been using prefix arguments.But now that I think about it, I may have been using manual-merge for the commits that worked and using automatic-merge due to memory lapse. Automatic doesn't see to set any options.
eswat
@eswat: interesting: that may be the key different and the cause of your problem. Do you have any way to test and confirm that?
VonC
@VonC: yeah, just confirmed it. The merge commit messages with separate objects don't use the default merge message git uses, so I had to have set them myself, using manual-merge.
eswat