Custom hooks

This custom hook implementation support pre-receive, post-receive and update hooks. If a gitlab administrator wants to add a custom hook they need to follow these steps:

1. Create a `custom_hooks` directory in the repository directory adjacent to the normal `hooks` directory. For example, if the repo path is `/home/git/repositories/my_group/my_project.git`, the custom hook path will be `/home/git/repositories/my_group/my_project.git/custom_hooks`
1. Create/place a hook of the desired type in this `custom_hooks` directory. 
1. Make the hook file executable and owned by the git user.
1. Profit. The new custom hook should be picked up by gitlab-shell on the next push. If there are errors in the custom hook the push may fail, unless it's post-receive.  If the hook is not owned by git or is not executable the custom hook will silently fail.

## What's missing?
1. Other hooks types - pre-commit/etc
In a nutshell, this function emulates the pre- andpost-receive hook API that a standalone git provides. To be more precise, the git interface for the pre-receive and post-receive comments sends the information of what branch and references have changed directly thru stdin, not thru the command line arguments. This is what this function does. Like @dblessing said, you can push multiple branches. That's the other part that this function does, feeding each line thru stdin. This has the benefit that you can use standard git hook code as we respect the API.