diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-05-01 09:03:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-01 09:03:06 -0500 |
commit | a3f5c0ce84f32ada05d718d3e6e5a505ec0f9221 (patch) | |
tree | 3c51f5d717561f9275238d780a2b00a682f0fb8c /hack/hooks/README.md | |
parent | 0d2d82f2718cd4674020821c9f00371aa5bc6ee0 (diff) | |
parent | d8a70bbd179c59e121a652f2b590f65ed7889eab (diff) | |
download | openshift-a3f5c0ce84f32ada05d718d3e6e5a505ec0f9221.tar.gz openshift-a3f5c0ce84f32ada05d718d3e6e5a505ec0f9221.tar.bz2 openshift-a3f5c0ce84f32ada05d718d3e6e5a505ec0f9221.tar.xz openshift-a3f5c0ce84f32ada05d718d3e6e5a505ec0f9221.zip |
Merge pull request #4027 from tbielawa/contrib_pre-commit_hook
Merged by openshift-bot
Diffstat (limited to 'hack/hooks/README.md')
-rw-r--r-- | hack/hooks/README.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/hack/hooks/README.md b/hack/hooks/README.md new file mode 100644 index 000000000..ef870540a --- /dev/null +++ b/hack/hooks/README.md @@ -0,0 +1,37 @@ +# OpenShift-Ansible Git Hooks + +## Introduction + +This `hack` sub-directory holds +[git commit hooks](https://www.atlassian.com/git/tutorials/git-hooks#conceptual-overview) +you may use when working on openshift-ansible contributions. See the +README in each sub-directory for an overview of what each hook does +and if the hook has any specific usage or setup instructions. + +## Usage + +Basic git hook usage is simple: + +1) Copy (or symbolic link) the hook to the `$REPO_ROOT/.git/hooks/` directory +2) Make the hook executable (`chmod +x $PATH_TO_HOOK`) + +## Multiple Hooks of the Same Type + +If you want to install multiple hooks of the same type, for example: +multiple `pre-commit` hooks, you will need some kind of *hook +dispatcher*. For an example of an easy to use hook dispatcher check +out this gist by carlos-jenkins: + +* [multihooks.py](https://gist.github.com/carlos-jenkins/89da9dcf9e0d528ac978311938aade43) + +## Contributing Hooks + +If you want to contribute a new hook there are only a few criteria +that must be met: + +* The hook **MUST** include a README describing the purpose of the hook +* The README **MUST** describe special setup instructions if they are required +* The hook **MUST** be in a sub-directory of this directory +* The hook file **MUST** be named following the standard git hook + naming pattern (i.e., pre-commit hooks **MUST** be called + `pre-commit`) |