I implemented the following to git commit after a file is saved. It works, I think, but the commit message, rather than being empty, is the literal value ''
. This is the case whether or not I have any text in the quotes after the -m
.
I expect my quoting is wrong - can someone confirm or deny please?
(defun my-after-save-actions ()
"Used in `after-save-hook'."
(if (string-match-p (regexp-quote "Journal.org") (buffer-file-name))
(shell-command "git add Journal.org && git commit --allow-empty-message -m ''")
)
)
(add-hook 'after-save-hook 'my-after-save-actions)
M-: (shell-command "git add Journal.org && git commit --allow-empty-message -m ''") RET
but I cannot reproduce the problem.