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