From eeb52a87f6d869d8790936f8dd628c08744d0b5d Mon Sep 17 00:00:00 2001 From: Eebs Kobeissi Date: Mon, 18 Nov 2019 09:23:38 -0500 Subject: [PATCH] Adds a commit-msg git hook People may wish to configure a `commit-msg` hook in their local dotfiles. This allows them to do so by adding a [`commit-msg` git hook][1] that checks for the presence of a local `commit-msg` hook, and runs it if present. This hook follows the existing pattern we use for other git hooks. [1]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks --- git_template/hooks/commit-msg | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 git_template/hooks/commit-msg diff --git a/git_template/hooks/commit-msg b/git_template/hooks/commit-msg new file mode 100755 index 0000000..0766fc7 --- /dev/null +++ b/git_template/hooks/commit-msg @@ -0,0 +1,7 @@ +#!/bin/sh + +local_hook="$HOME"/.git_template.local/hooks/commit-msg + +if [ -f "$local_hook" ]; then + . "$local_hook" +fi