gitlabhq/gitlabhq — pull request #6883 by mavimo (2014-04-27 11:34:04+00:00)
Title: Git hook UI management

This is a PoC to add a Gitlab UI to mange git hooks.
### Refs
* [selecting git repo hooks via the gitlab gui](http://feedback.gitlab.com/forums/176466-general/suggestions/4511318-selecting-git-repo-hooks-via-the-gitlab-gui)
* [allow new repositories to have default hook script](http://feedback.gitlab.com/forums/176466-general/suggestions/5496298-allow-new-repositories-to-have-default-hook-script)

### UI
![screen shot 2014-04-27 at 13 14 37](https://cloud.githubusercontent.com/assets/43941/2811032/3a2e5676-cdfe-11e3-8b15-6eb554ded922.png)

### How to use
We need to use gitlab-shell with [MR#150](https://github.com/gitlabhq/gitlab-shell/pull/150)
In gitlab-shell hooks folder create a new script (bash, ruby, python, nodejs, ...). The file name must be unique and do not need to refer to hook name (eg: ```test1```).

Create a new JSON file with the same name of script (eg: ```test1.json```) with hook description, like:
```
{
"name": "Coding standard (PHP - PSR2)",
"description": "Process php and inc files using PHP_CodeSniffer using PSR2 standard.",
"hook": "pre-receive",
"version": "1.0.0"
}
```
all items are required.

Go to project settings area and click on Githooks link. Enable or disable the git hooks for the repo.

### We need to
- [ ] add tests
- [ ] move some elements (load, list, ...) in a specific model (Githook?) and include it in controller
- [ ] add hooks container folder in a configurable directory