mix git_ops.message_hook (Git Ops v2.1.0) View Source

Installs a Git commit-msg hook to automatically check if the commit message follows the Conventional Commits spec:

mix git_ops.msg_hook

The actual check is done by using the git_ops.check_message mix task:

mix git_ops.check_message /path/to/commit/message/file

It does nothing if a Git commit-msg hook already exists that contains the above message validation task (unless --force was used).

Logs an error if a Git commit-msg hook exists but it does not call the message validation task.

Switches:

  • --force|-f - Overwrites the Git commit-msg hook if one exists but it does not call the message validation task.

  • --uninstall - Uninstalls the git commit-msg hook if it exists.

  • --verbose|-v - Be more verbose. Pass this option twice to be even more verbose.