I PGP sign my commit messages, and every once in a while GPG will fail for whatever reason (invalid cache, incorrect pin, etc), and my fugitive buffer will close, loosing all my changes.
It doesn't happen often, but when it does it's really frustrating because I like to write thorough commit messages.
My question is, does anyone have a suggestion of how to retrieve the message I wrote after the commit fails?
Thanks in advance.
.git/COMMIT_MESSAGE
or similar. – D. Ben Knoble♦ Feb 1 '19 at 22:41.git/COMMIT_MESSAGE
but it wasn't present. Maybe git thinks if GPG encryption fails it should wipe the message? – bronzehedwick Feb 2 '19 at 20:12BufPreWrite
or similar command to make a backup of the message? – D. Ben Knoble♦ Feb 2 '19 at 20:17.git/COMMIT_EDITMSG
– D. Ben Knoble♦ Feb 4 '19 at 18:38.git/COMMIT_EDITMSG
! I'll be able to write a command similar to what you provided in second part of your answer to leverage it inside vim. If you want to update your answer below to just include.git/COMMIT_EDITMSG
i'll upvote and mark as answer. – bronzehedwick Feb 5 '19 at 16:30