bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

Disable pre-commit hook for specific commit message #107

Open martinschayna opened 7 years ago

martinschayna commented 7 years ago

I want to disable pre-commit hook (such as git commit -n option does) for specific commit messages. For example when developer wants to commit work in progress to the local repository only, it could be possible to use commit message with WIP prefix and pre-commit hook won't be fired.

To make it clear, WIP commits are bad in the remote repository and definitely they won't be merged here. This could be handy only for developers who have to use IDEs like WebStorm, where isn't built-in support for no-verify commit option (yet).

I would like to check commit message directly in my script, but I didn't found anything about how to obtain current message from checked commit. Is it any chance for this?