git.droids-corp.org
/
git-central.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4aca6f6
)
post-receive-hudson: Default USER_EMAIL to the committer's email address.
author
Stephen Haberman
<stephen@exigencecorp.com>
Thu, 14 Apr 2011 23:41:57 +0000
(18:41 -0500)
committer
Stephen Haberman
<stephen@exigencecorp.com>
Thu, 14 Apr 2011 23:45:11 +0000
(18:45 -0500)
Patch by Aaron Boxer.
server/post-receive-hudson
patch
|
blob
|
history
diff --git
a/server/post-receive-hudson
b/server/post-receive-hudson
index
2e2ea07
..
45ce301
100755
(executable)
--- a/
server/post-receive-hudson
+++ b/
server/post-receive-hudson
@@
-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
# 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
#
. $(dirname $0)/functions
@@
-39,6
+40,10
@@
while read oldrev newrev refname ; do
exit 0
fi
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
branch_config=$(wget -O - $hudson_url/job/${short_refname}/config.xml 2>/dev/null)
if [ $? -ne 0 ] ; then
# Create the job