123r
Dependencies: WNC14A2AInterface
mcr20a-rf-driver/.git/hooks/commit-msg.sample@0:2563b0415d1f, 2017-04-19 (annotated)
- Committer:
- JMF
- Date:
- Wed Apr 19 01:13:10 2017 +0000
- Revision:
- 0:2563b0415d1f
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 0:2563b0415d1f | 1 | #!/bin/sh |
JMF | 0:2563b0415d1f | 2 | # |
JMF | 0:2563b0415d1f | 3 | # An example hook script to check the commit log message. |
JMF | 0:2563b0415d1f | 4 | # Called by "git commit" with one argument, the name of the file |
JMF | 0:2563b0415d1f | 5 | # that has the commit message. The hook should exit with non-zero |
JMF | 0:2563b0415d1f | 6 | # status after issuing an appropriate message if it wants to stop the |
JMF | 0:2563b0415d1f | 7 | # commit. The hook is allowed to edit the commit message file. |
JMF | 0:2563b0415d1f | 8 | # |
JMF | 0:2563b0415d1f | 9 | # To enable this hook, rename this file to "commit-msg". |
JMF | 0:2563b0415d1f | 10 | |
JMF | 0:2563b0415d1f | 11 | # Uncomment the below to add a Signed-off-by line to the message. |
JMF | 0:2563b0415d1f | 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg |
JMF | 0:2563b0415d1f | 13 | # hook is more suited to it. |
JMF | 0:2563b0415d1f | 14 | # |
JMF | 0:2563b0415d1f | 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') |
JMF | 0:2563b0415d1f | 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" |
JMF | 0:2563b0415d1f | 17 | |
JMF | 0:2563b0415d1f | 18 | # This example catches duplicate Signed-off-by lines. |
JMF | 0:2563b0415d1f | 19 | |
JMF | 0:2563b0415d1f | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | |
JMF | 0:2563b0415d1f | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { |
JMF | 0:2563b0415d1f | 22 | echo >&2 Duplicate Signed-off-by lines. |
JMF | 0:2563b0415d1f | 23 | exit 1 |
JMF | 0:2563b0415d1f | 24 | } |