Fork of my original MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:43:14 2017 +0000
Revision:
0:a1734fe1ec4b
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vpcola 0:a1734fe1ec4b 1 #!/bin/sh
vpcola 0:a1734fe1ec4b 2 #
vpcola 0:a1734fe1ec4b 3 # An example hook script to check the commit log message.
vpcola 0:a1734fe1ec4b 4 # Called by "git commit" with one argument, the name of the file
vpcola 0:a1734fe1ec4b 5 # that has the commit message. The hook should exit with non-zero
vpcola 0:a1734fe1ec4b 6 # status after issuing an appropriate message if it wants to stop the
vpcola 0:a1734fe1ec4b 7 # commit. The hook is allowed to edit the commit message file.
vpcola 0:a1734fe1ec4b 8 #
vpcola 0:a1734fe1ec4b 9 # To enable this hook, rename this file to "commit-msg".
vpcola 0:a1734fe1ec4b 10
vpcola 0:a1734fe1ec4b 11 # Uncomment the below to add a Signed-off-by line to the message.
vpcola 0:a1734fe1ec4b 12 # Doing this in a hook is a bad idea in general, but the prepare-commit-msg
vpcola 0:a1734fe1ec4b 13 # hook is more suited to it.
vpcola 0:a1734fe1ec4b 14 #
vpcola 0:a1734fe1ec4b 15 # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
vpcola 0:a1734fe1ec4b 16 # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
vpcola 0:a1734fe1ec4b 17
vpcola 0:a1734fe1ec4b 18 # This example catches duplicate Signed-off-by lines.
vpcola 0:a1734fe1ec4b 19
vpcola 0:a1734fe1ec4b 20 test "" = "$(grep '^Signed-off-by: ' "$1" |
vpcola 0:a1734fe1ec4b 21 sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
vpcola 0:a1734fe1ec4b 22 echo >&2 Duplicate Signed-off-by lines.
vpcola 0:a1734fe1ec4b 23 exit 1
vpcola 0:a1734fe1ec4b 24 }