1

This looks similar (the same?) as How to prevent Magit from saving COMMIT_EDITMSG? but I've also confirmed that the problem isn't magit itself, but interactions with settings or other packages.

I'm having the same issue as 46965 (though it just started recently) -- my second commit goes to the previous git commit and bypasses the options for commits.

I am definitely using C-c C-c to commit and I see the commit in the log.

I tried running a bare magit using the info in the debug section of the manual -- that instance worked as it's supposed to (goes to the options). So it sounds like either settings or other packages are causing the problem. I turned off all other magit packages (magit-section, magit-todos, vdiff-magit) but the problem is still there.

Has anyone else seen this behaviour and found out what the offending setting/package is?

My setup: Magit 20200228.1207, Git 2.25.1, Emacs 28.0.50, gnu/linux

  • Try using github.com/Malabarba/elisp-bug-hunter to track down the issue. – phils Mar 2 at 2:15
  • I ran into this issue as well; for me it was caused by (setq server-kill-new-buffers nil). I'm not sure if this is a general fix though. (Emacs 27.0.90) – ddavis Mar 3 at 13:40
  • Thanks @phils -- I didn't know about the bug hunter. I'll have to check it out. – bed Mar 3 at 23:37
  • @ddavis -- I looked at this and changing it to (setq server-kill-new-buffers t) fixed it. Thanks! Looking at the help for that variable it does make sense. But if you want to keep buffers around then you can use server-temp-file-regexp to add the git edit message buffer to it, and leave server-kill-new-buffers nil. – bed Mar 3 at 23:38
1

@ddavis answered this question in a comment!

Changing setq server-kill-new_buffers to t:

(setq server-kill-new-buffers t)

fixed this issue. This will kill buffers given to the server, when the user is done with it, unless the buffer already existed. If this would cause another problem then you can leave that variable as nil and add a regexp for this buffer to server-temp-file-reg-exp which will tell the server that this file is a temp file so that it can kill it once you finish.

Thanks @ddavis !

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.