Skip to contentSkip to conversation

git.el: Include MERGE_MSG in the log-edit buffer even when not committing a merge.

PATCH New Alexandre Julliard 1 participant 1 message Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 git.el: Include MERGE_MSG in the log-edit buffer even when not committing a merge.

This lets us take advantage of the fact that git-cherry-pick now saves the message in MERGE_MSG too.

---
 contrib/emacs/git.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
contrib/emacs/git.el +2 -1
index 6f3b46d..972c402 100644
@@ -589,6 +589,7 @@ and returns the process output as a stri
                           (let ((commit (git-commit-tree buffer tree head)))
                             (git-update-ref "HEAD" commit head)
                             (condition-case nil (delete-file ".git/MERGE_HEAD") (error nil))
+                            (condition-case nil (delete-file ".git/MERGE_MSG") (error nil))
                             (with-current-buffer buffer (erase-buffer))
                             (git-set-files-state files 'uptodate)
                             (when (file-directory-p ".git/rr-cache")
@@ -888,7 +889,7 @@ and returns the process output as a stri
           'face 'git-header-face)
          (propertize git-log-msg-separator 'face 'git-separator-face)
          "\n")
-        (cond ((and merge-heads (file-readable-p ".git/MERGE_MSG"))
+        (cond ((file-readable-p ".git/MERGE_MSG")
                (insert-file-contents ".git/MERGE_MSG"))
               (sign-off
                (insert (format "\n\nSigned-off-by: %s <%s>\n"
Signature · 4 lines
1.4.3.3.gf3240

-- 
Alexandre Julliard