tags:

views:

48

answers:

1

I'm using Git's post-receive hook to send out an email after a commit has been made. it currently includes the git branch, commit hash, repo name, etc.

How does one include in the subject line the user who made the commit in addition to the commit message instead?

+1  A: 

Hi RandomBits,

git log  --pretty=format:'%T %cN %ce'

Will give you output in the form "commit SHA1 Committer-Name [email protected]"

All sorts of other options available too: http://www.kernel.org/pub/software/scm/git/docs/git-log.html

There's a script here: http://stackoverflow.com/questions/223678/git-which-commit-has-this-blob which you should then be able to modify or use the principle of to help; if post-receive-email can be written in python or perl you can split the correct line for the SHA1 blob you need.

Ninefingers