Mercurial > lasercutter
diff graster/hacklab-engraver/.git/hooks/commit-msg.sample @ 11:f952052e37b7
trying a fix.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 24 Aug 2010 19:06:45 -0400 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/graster/hacklab-engraver/.git/hooks/commit-msg.sample Tue Aug 24 19:06:45 2010 -0400 1.3 @@ -0,0 +1,24 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# An example hook script to check the commit log message. 1.7 +# Called by git-commit with one argument, the name of the file 1.8 +# that has the commit message. The hook should exit with non-zero 1.9 +# status after issuing an appropriate message if it wants to stop the 1.10 +# commit. The hook is allowed to edit the commit message file. 1.11 +# 1.12 +# To enable this hook, rename this file to "commit-msg". 1.13 + 1.14 +# Uncomment the below to add a Signed-off-by line to the message. 1.15 +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg 1.16 +# hook is more suited to it. 1.17 +# 1.18 +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 1.19 +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 1.20 + 1.21 +# This example catches duplicate Signed-off-by lines. 1.22 + 1.23 +test "" = "$(grep '^Signed-off-by: ' "$1" | 1.24 + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 1.25 + echo >&2 Duplicate Signed-off-by lines. 1.26 + exit 1 1.27 +}