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