pre-push 933 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # This hook script prevents the user from pushing to Savannah if any of the new
  3. # commits' OpenPGP signatures cannot be verified, or if a commit is signed
  4. # with an unauthorized key.
  5. # Called by "git push" after it has checked the remote status, but before
  6. # anything has been pushed. If this script exits with a non-zero status nothing
  7. # will be pushed.
  8. #
  9. # This hook is called with the following parameters:
  10. #
  11. # $1 -- Name of the remote to which the push is being done
  12. # $2 -- URL to which the push is being done
  13. #
  14. # If pushing without using a named remote those arguments will be equal.
  15. #
  16. # Information about the commits which are being pushed is supplied as lines to
  17. # the standard input in the form:
  18. #
  19. # <local ref> <local sha1> <remote ref> <remote sha1>
  20. # Only use the hook when pushing to Savannah.
  21. case "$2" in
  22. *.gnu.org*)
  23. exec make authenticate check-channel-news
  24. exit 127
  25. ;;
  26. *)
  27. exit 0
  28. ;;
  29. esac