Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. RED=$(tput setaf 1)
  4. NORMAL=$(tput sgr0)
  5.  
  6. # FIXME: I am using porcelain commands to do plumbing work. Maybe fix it in the
  7. # future.
  8. AUTHOR=$(git --no-pager show -s --format='%aN <%aE>')
  9. COMMIT_MSG=$(git --no-pager show -s --format='%B')
  10. COMMIT_ID=$(git --no-pager show -s --format='%h')
  11.  
  12. # See if the author signed off
  13. echo "$COMMIT_MSG" | grep "^Signed-off-by: $AUTHOR" > /dev/null
  14.  
  15. if test $? -eq 0; then
  16. exit 0
  17. else
  18. printf "%sAuthor of commit $COMMIT_ID did not sign off%s\n" $RED $NORMAL
  19. exit 1
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement