tags:

views:

83

answers:

1

How to configure the git user.name to enable Hudson send out email to the user who commit code?

I just follow the standard way to configure the git user.name with "User Name (userid)", see below.

git config --global user.name "Euler XXXX (euler)"

git config --global user.email "[email protected]"

Then I commit the code to git repository, which trigger Hudson build. But it was failed to send out the email to me with email [email protected].

See the Hudson log as below:

...
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Sep 10 15:05:51 CST 2010
[INFO] Final Memory: 3M/74M
[INFO] ----

--------------------------------------------------------------------


**Failed to send e-mail to Euler XXXX (euler) because no e-mail address is known, and no default e-mail domain is configured**
...

In Hudson configuration, I configured "LDAP Email Lookup", which provided by Hudson LDAP email plugin.

While if I configure the user.name with the userid, which is userid in my LDAP server, then the Hudson build can find email address.

+1  A: 

git config --global writes to global ~/.gitconfig file.

Your problem comes from the fact that ~ used when you typed the git config is not the same than the ~ used by the user actually executing the Hudson job.

Check and make sure of the user home actually involved in that Hudson job execution.

VonC
Thanks! The hudson server is executed under oher user A for intergraion. while user B commit code. I just expect the email notify to user B.