Skip to content

Commit

Permalink
post-receive-hudson: Default USER_EMAIL to the committer's email addr…
Browse files Browse the repository at this point in the history
…ess.

Patch by Aaron Boxer.
  • Loading branch information
Stephen Haberman committed Apr 14, 2011
1 parent 4aca6f6 commit 080aad7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/post-receive-hudson
Expand Up @@ -14,7 +14,8 @@
# Whitespace separated list of branches to not make jobs for.
# USER_EMAIL
# Environment variable that should be set by your repository-specific
# post-receive hook. E.g. export USER_EMAIL=${USER}@example.com
# post-receive hook. E.g. export USER_EMAIL=${USER}@example.com. If
# unset, defaults to the email by of the pushed commit.
#

. $(dirname $0)/functions
Expand All @@ -39,6 +40,10 @@ while read oldrev newrev refname ; do
exit 0
fi

if [ -z "$USER_EMAIL" ] ; then
USER_EMAIL=$(git log -1 --pretty=format:'%ce' $newrev)
fi

branch_config=$(wget -O - $hudson_url/job/${short_refname}/config.xml 2>/dev/null)
if [ $? -ne 0 ] ; then
# Create the job
Expand Down

0 comments on commit 080aad7

Please sign in to comment.