Git: post-receive email hook, including diff patches?
git
Solution
Recent Git version should install a `post-receive-email` script. In it, it says:
hooks.showrev
The shell command used to format each revision in the email, with "%s" replaced with the commit id. Defaults to "git rev-list -1 --pretty %s", displaying the commit id, author, date and log message. To list full patches separated by a blank line, you could set this to "git show -C %s; echo".
So just set `hooks.showrev` to “git show -C %s; echo” in the repository with the email hook and you’re all set.
Problem
I found a post-receive hook for Git after some googling that I use to e-mail all commits to a remote/shared repo. The problem with this post-receive hook is that it only has the capability to provide who made the commit, the log message, date, file(s) affected. I also want to see the affected file(s) generated patches in the e-mail to see what changes were made to the code. Subversion does this rather nicely. Does anyone have a solution for perhaps an env-variable that may be passed to the post-receive hook that does this? Or even better, an example that is already cooked up? Thanks all!