Git commit message templates

Ed Maste emaste at freebsd.org
Thu Dec 17 20:48:47 UTC 2020


On Wed, 16 Dec 2020 at 11:58, Ed Maste <emaste at freebsd.org> wrote:
>
> One outstanding Git transition item is work on commit message
> templates. We currently have an SVN template that lists the metadata
> fields we use, such as PR:, Reviewed by:, and such. Git supports local
> commit hooks (in .git/hooks) and I've made a trivial port of that to a
> git commit message preparation hook. I imagine we'd have these in the
> tree (in tools/tools/git/hooks/) and provide either documentation or a
> script to install or symlink them into the user's .git/hooks/
> directory.
>
> The current trivial hook is open in https://reviews.freebsd.org/D27633.

I've now committed this to tools/tools/git/hooks, and it can be
installed by placing it in .git/hooks of a doc/src/ports repository.
(If you're using worktrees then it's the .git directory of the main
repository, and the same hook will be used for all worktrees.)

To install it you could run:
% cp -p tools/tools/git/hooks/prepare-commit-msg .git/hooks/


More information about the freebsd-git mailing list