Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

post-receive-hudson: Default USER_EMAIL to the committer's email addr…

…ess.

Patch by Aaron Boxer.
  • Loading branch information...
commit 080aad76176bda0daef478cc1b6cd8fcbfc08112 1 parent 4aca6f6
Stephen Haberman authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 server/post-receive-hudson
7 server/post-receive-hudson
View
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.