Prologue
I want to create a pre-receive hook
from my pre-push hook
. Now, looking around the 'net and the SO, I have found many questions pertaining to specific problems, and/or focusing on a description of the hook, instead of actually showing it (I'm looking at you, git-scm).
The point
So anyway, as far as I have gathered, pre-receive hook
is called with no parameters. How do I get data then? There is very much data that I would see myself wanting to get a hold of in such hook, for example:
- pushername (pardon the pun)
- commit message
- timestamp
- changed files
- target branch
but I honestly have no idea how to get the data - and I know that people do it, because I have seen such scripts in action.
Assumptions
I would like to assume that it's bash
-doable, because the less configuration the better, amirite?