Toyomasa Watarai / simple-mbed-cloud-client

Dependents:  

Committer:
MACRUM
Date:
Mon Jul 02 06:30:39 2018 +0000
Revision:
0:276e7a263c35
Initial commit

Who changed what in which revision?

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