I am using Magit. After staging some changes, when I press to commit something, Magit opens a buffer like this:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch feature-no-procrastinate-mode
# Your branch is ahead of 'origin/feature-no-procrastinate-mode' by 4 commits.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: source/mode/no-procrastinate.lisp
#
# Untracked files:
# source/no-procrastinate.lisp~
#
Every time this happens I do the following:
1 - I remove all comments until the line with source/mode/no-procrastinate.lisp
. There, I usually keep the file name, I add :
and,
2 - I write something meaningful about the changes. For instance, the final result of the manual changes would be:
source/mode/no-procrastinate.lisp: insert documentation strings.
#
# Untracked files:
# source/no-procrastinate.lisp~
#
On one hand, I bet step 1 can be automated with a short elisp function and a hook. On the other hand, step 2 probably can't be automated (yet - let's wait for a new generation of AI :D).
How can I automate step 1? What would be a cool function and a hook for it?
Or, what if it was a command instead of a hook so that it was not completely automatic?
I still do not know much about Elisp to write this from scratch.