From 50bad0094b4290abab51aac89b837af1ab8b5491 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 26 Oct 2014 10:05:43 +0100 Subject: [PATCH] Add setup_commit_msg_hook.sh License: MIT Signed-off-by: Christian Couder --- setup_commit_msg_hook.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 setup_commit_msg_hook.sh diff --git a/setup_commit_msg_hook.sh b/setup_commit_msg_hook.sh new file mode 100755 index 00000000000..b2f6f21c545 --- /dev/null +++ b/setup_commit_msg_hook.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +cat >.git/hooks/commit-msg <<'EOF' +#!/bin/sh + +grep "^License:" "$1" || { + echo >>"$1" + echo "License: MIT" >>"$1" + echo "Signed-off-by: $(git config user.name) <$(git config user.email)>" >>"$1" +} +EOF +chmod +x .git/hooks/commit-msg +