#
# Config
# ------
-# hooks.mailinglist
+# hooks.post-receive-email.mailinglist
# This is the list that all pushes will go to; leave it blank to not send
# emails for every ref update.
-# hooks.announcelist
+# hooks.post-receive-email.announcelist
# This is the list that all pushes of annotated tags will go to. Leave it
# blank to default to the mailinglist field. The announce emails lists
# the short log summary of the changes since the last annotated tag.
-# hooks.envelopesender
+# hooks.post-receive-email.envelopesender
# If set then the -f option is passed to sendmail to allow the envelope
# sender address to be set
#
if [ -z "$recipients" ]; then
case "$refname_type" in
"annotated tag")
- config_name="hooks.announcelist"
+ config_name="hooks.post-receive-email.announcelist"
;;
*)
- config_name="hooks.mailinglist"
+ config_name="hooks.post-receive-email.mailinglist"
;;
esac
echo >&2 "*** $config_name is not set so no email will be sent"
projectdesc="UNNAMED PROJECT"
fi
-recipients=$(git config hooks.mailinglist)
-announcerecipients=$(git config hooks.announcelist)
-envelopesender=$(git config hooks.envelopesender)
+recipients=$(git config hooks.post-receive-email.mailinglist)
+announcerecipients=$(git config hooks.post-receive-email.announcelist)
+envelopesender=$(git config hooks.post-receive-email.envelopesender)
emailprefix="[$projectdesc]"
-debug=$(git config hooks.debug)
+debug=$(git config hooks.post-receive-email.debug)
# --- Main loop
# Allow dual mode: run from the command line just like the update hook, or
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] master branch updated. $new_commit_hash
X-Git-Refname: refs/heads/master
. ./test-lib.sh
+export USER=author
+
test_expect_success 'setup' '
echo "setup" >a &&
git add a &&
git remote add origin ./server &&
git config --add branch.master.remote origin &&
git config --add branch.master.merge refs/heads/master &&
- GIT_DIR=./server/.git git config --add hooks.mailinglist commits@list.com &&
- GIT_DIR=./server/.git git config --add hooks.debug true &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.mailinglist commits@list.com &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.debug true &&
GIT_DIR=.
echo cbas >./server/.git/description
'
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] 1.0 annotated tag created. 1.0
X-Git-Refname: refs/tags/1.0
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] master branch updated. 1.0-2-g$new_commit_abbrev
X-Git-Refname: refs/heads/master
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] 2.0 annotated tag created. 2.0
X-Git-Refname: refs/tags/2.0
. ./test-lib.sh
+export USER=author
+
test_expect_success 'setup' '
echo "setup" >a &&
git add a &&
git remote add origin ./server &&
git config --add branch.master.remote origin &&
git config --add branch.master.merge refs/heads/master &&
- GIT_DIR=./server/.git git config --add hooks.mailinglist commits@list.com &&
- GIT_DIR=./server/.git git config --add hooks.debug true &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.mailinglist commits@list.com &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.debug true &&
GIT_DIR=.
echo cbas >./server/.git/description
'
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] topic branch created. $new_commit_hash
X-Git-Refname: refs/heads/topic
+From: author@payflex.com
To: commits@list.com
Subject: [cbas] topic branch deleted. $old_commit_hash
X-Git-Refname: refs/heads/topic
. ./test-lib.sh
+export USER=author
+
test_expect_success 'setup' '
echo "setup" >a &&
git add a &&
git remote add origin ./server &&
git config --add branch.master.remote origin &&
git config --add branch.master.merge refs/heads/master &&
- GIT_DIR=./server/.git git config --add hooks.mailinglist commits@list.com &&
- GIT_DIR=./server/.git git config --add hooks.debug true &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.mailinglist commits@list.com &&
+ GIT_DIR=./server/.git git config --add hooks.post-receive-email.debug true &&
GIT_DIR=.
echo cbas >./server/.git/description
'