Crate git2_hooks
source ·Expand description
git2-rs addon supporting git hooks
we look for hooks in the following locations:
- whatever
config.hooksPathpoints to .git/hooks/- whatever list of paths provided as
other_paths(in order)
most basic hook is: hooks_pre_commit. see also other hooks_* functions.
create_hook is useful to create git hooks from code (unittest make heavy usage of it)
Enums
Constants
Functions
- helper method to create git hooks programmatically (heavy used in unittests)
- this hook is documented here https://git-scm.com/docs/githooks#_commit_msg we use the same convention as other git clients to create a temp file containing the commit message at
<.git|hooksPath>/COMMIT_EDITMSGand pass it’s relative path as the only parameter to the hook script. - this hook is documented here https://git-scm.com/docs/githooks#_post_commit
- this hook is documented here https://git-scm.com/docs/githooks#_pre_commit