Hi All,

A few hours ago I noticed that I’ve made a few very minor mistakes in some of my recent commit messages for Org. Realistically I don’t think I’m going to stop making occasional mistake any time soon, eve if they do become rarer. So, I’ve whipped up a magit hook that looks at the diff and fills in a correct skeleton in the commit message buffer.

For example, here’s what I get if a queue a few of my currently unstaged changes

* lisp/org.el (org-place-formula-image, org-format-latex):

* lisp/org-macs.el (org-compile-file, org-async-queue):

This currently works with elisp functions/variables/etc. and headings from documentation files. I’m sure it has a few rough edges, but it’s looking promising so far.

Maybe a few of you might also find it of interest? https://tecosaur.github.io/emacs-config/config.html#commit-message-templates (the relevant commit is https://github.com/tecosaur/emacs-config/commit/d1e3042a).

Another thought I’ve had is a commit lint function for flycheck to check some extra things (two spaces after sentences, commit subject starting with a capital letter, etc.), but I haven’t looked into that at all.

All the best,
Timothy