git pre-commit hook bypass email

I have a pre-commit hook that runs PHP Codesniffer on all files in the staging area. However, sometimes developers bypass this hook by adding –no-verify option to the git commit command. Is there a way I can send an email each time a developer bypasses the hook?

  • PHPStorm 8 version control (git) scope to ignore files in PHP_CodeSniffer
  • Git: pre-receive hook with PHP_CodeSniffer
  • Git pre-receive hook to launch PHP CodeSniffer
  • How to Ignore Line Length PHP_CodeSniffer
  • Using Jenkins and Php Code Sniffer
  • Storyboard error unarchiving document objects - *** -: object cannot be nil
  • Can additional data be put into a git commit object?
  • Rebase branch after GitHub “Squash and merge” onto master
  • git add will not stage certain files
  • Git reset files with typechange status
  • git squash and preserve last commit's timestamp
  • One Solution collect form web for “git pre-commit hook bypass email”

    Too long for a comment, but probably not a complete answer.

    Whooph… In the DVCS world everything that happens in a private repo is a private business. You as a team repository administrator can propose them some facilities to enhance and simplify their job, but you shouldn’t overcarry.

    You, however, can and actually should put some automatic sanity checks on receiving their commits on the team repository side. Likely pre-receive hook is a better place for obligatory checks.

    Alternatively, and indeed it’s recommended for any “valuable” project, you could set up a more complex system for code review (our team uses gerrit but there’re plenty of them including those written in PHP). Thus, your team members will familiarize themselves with other members works, suggest improvements and so on, while robots will perform routine tasks, like checking code-style, running unit- and integration tests and so on.

    Git Baby is a git and github fan, let's start git clone.