Artificial intelligent assistant

Is git commit message recoverable if committing fails for some reason? `git commit` can fail for reasons such as `gpg.commitsign = true` && `gpg` fails (for whatever reason). Retrying the command opens a blank editor; the message is lost. When this happens, is there any way to recover the written commit message, to retry committing with the same message?

From `man git-commit`:


FILES
$GIT_DIR/COMMIT_EDITMSG
This file contains the commit message of a commit in progress. If git commit exits due to an error before creating a commit, any commit message that has been provided
by the user (e.g., in an editor session) will be available in this file, but will be overwritten by the next invocation of git commit.


So, rather than repeat `git commit`, to retry with the previous message one can use:


$ git commit -m "$(cat .git/COMMIT_EDITMSG)"


Or in general (suitable for an alias for example):


$ git commit -m "$(cat "$(git rev-parse --git-dir)/COMMIT_EDITMSG)")"

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 429a3b31cc7517aec56b77d0d7bad767