this is testing

Committer:
pmallick
Date:
Thu Jan 14 19:12:57 2021 +0530
Revision:
0:e8a1ba50c46b
this is testing

Who changed what in which revision?

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