Hi Marek,

Le mardi 12 octobre 2010, Marek Wywiał a écrit :
> > I'm using the post-receive hook to send notification upon pushes on
> > a central repository. I'd like to set the sender address (in the
> > 'From' header) according to the respective "author" of the push, is
> > is possible?
> I think answer is here:
>  *
> http://stackoverflow.com/questions/2443908/how-do-i-make-git-post-receive-emails-be-sent-from-the-commit-author
>
> so, you can use:
>  * export USER_EMAIL=$(git log -1 --format=format:%ae HEAD)
> in your post-receive hook

Thanks for this information. Unfortunately, the 'USER_EMAIL'
environment variable does not seem to be used by the standard
post-receive hooks (i.e. the one that is shipped with git in contrib).
I've found a workaround that consists of re-setting the
hooks.envelopesender option upon each push. For me, the following
post-receive works fine:

 #!/bin/sh

 git config hooks.envelopesender $(git log -1 --pretty=format:%ae
HEAD)
 . /usr/share/doc/git-core/contrib/hooks/post-receive-email


Cheers,

Denis

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to