Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- RED=$(tput setaf 1)
- NORMAL=$(tput sgr0)
- # FIXME: I am using porcelain commands to do plumbing work. Maybe fix it in the
- # future.
- AUTHOR=$(git --no-pager show -s --format='%aN <%aE>')
- COMMIT_MSG=$(git --no-pager show -s --format='%B')
- COMMIT_ID=$(git --no-pager show -s --format='%h')
- # See if the author signed off
- echo "$COMMIT_MSG" | grep "^Signed-off-by: $AUTHOR" > /dev/null
- if test $? -eq 0; then
- exit 0
- else
- printf "%sAuthor of commit $COMMIT_ID did not sign off%s\n" $RED $NORMAL
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement