From 969d385cfec7b449f9e67ddaba3595589b34d945 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Thu, 14 Aug 2008 12:48:36 -0500 Subject: [PATCH] Move post-receive-email settings to a subsection. --- server/post-receive-email | 18 +++++++++--------- tests/t2200-1.txt | 1 + tests/t2200-server-post-receive-email.sh | 6 ++++-- tests/t2201-1.txt | 1 + tests/t2201-2.txt | 1 + tests/t2201-3.txt | 1 + tests/t2201-server-post-receive-email-tags.sh | 6 ++++-- tests/t2202-1.txt | 1 + tests/t2202-2.txt | 1 + ...t2202-server-post-receive-email-branches.sh | 6 ++++-- 10 files changed, 27 insertions(+), 15 deletions(-) diff --git a/server/post-receive-email b/server/post-receive-email index c132868..0f5ef61 100755 --- a/server/post-receive-email +++ b/server/post-receive-email @@ -25,14 +25,14 @@ # # 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 # @@ -141,10 +141,10 @@ generate_email() 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" @@ -621,11 +621,11 @@ then 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 diff --git a/tests/t2200-1.txt b/tests/t2200-1.txt index 1bcbb9a..c462cfe 100644 --- a/tests/t2200-1.txt +++ b/tests/t2200-1.txt @@ -1,3 +1,4 @@ +From: author@payflex.com To: commits@list.com Subject: [cbas] master branch updated. $new_commit_hash X-Git-Refname: refs/heads/master diff --git a/tests/t2200-server-post-receive-email.sh b/tests/t2200-server-post-receive-email.sh index 2ac0dcb..3cda758 100644 --- a/tests/t2200-server-post-receive-email.sh +++ b/tests/t2200-server-post-receive-email.sh @@ -4,6 +4,8 @@ test_description='server post-receive email notification' . ./test-lib.sh +export USER=author + test_expect_success 'setup' ' echo "setup" >a && git add a && @@ -13,8 +15,8 @@ test_expect_success 'setup' ' 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 ' diff --git a/tests/t2201-1.txt b/tests/t2201-1.txt index 187053f..633c311 100644 --- a/tests/t2201-1.txt +++ b/tests/t2201-1.txt @@ -1,3 +1,4 @@ +From: author@payflex.com To: commits@list.com Subject: [cbas] 1.0 annotated tag created. 1.0 X-Git-Refname: refs/tags/1.0 diff --git a/tests/t2201-2.txt b/tests/t2201-2.txt index 70d2182..30577a3 100644 --- a/tests/t2201-2.txt +++ b/tests/t2201-2.txt @@ -1,3 +1,4 @@ +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 diff --git a/tests/t2201-3.txt b/tests/t2201-3.txt index bb10a0c..cf693cb 100644 --- a/tests/t2201-3.txt +++ b/tests/t2201-3.txt @@ -1,3 +1,4 @@ +From: author@payflex.com To: commits@list.com Subject: [cbas] 2.0 annotated tag created. 2.0 X-Git-Refname: refs/tags/2.0 diff --git a/tests/t2201-server-post-receive-email-tags.sh b/tests/t2201-server-post-receive-email-tags.sh index 4e0e0f3..c7622ae 100644 --- a/tests/t2201-server-post-receive-email-tags.sh +++ b/tests/t2201-server-post-receive-email-tags.sh @@ -4,6 +4,8 @@ test_description='server post-receive email notification' . ./test-lib.sh +export USER=author + test_expect_success 'setup' ' echo "setup" >a && git add a && @@ -13,8 +15,8 @@ test_expect_success 'setup' ' 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 ' diff --git a/tests/t2202-1.txt b/tests/t2202-1.txt index bc5bb51..9c9d31a 100644 --- a/tests/t2202-1.txt +++ b/tests/t2202-1.txt @@ -1,3 +1,4 @@ +From: author@payflex.com To: commits@list.com Subject: [cbas] topic branch created. $new_commit_hash X-Git-Refname: refs/heads/topic diff --git a/tests/t2202-2.txt b/tests/t2202-2.txt index 2227e4d..6ad6464 100644 --- a/tests/t2202-2.txt +++ b/tests/t2202-2.txt @@ -1,3 +1,4 @@ +From: author@payflex.com To: commits@list.com Subject: [cbas] topic branch deleted. $old_commit_hash X-Git-Refname: refs/heads/topic diff --git a/tests/t2202-server-post-receive-email-branches.sh b/tests/t2202-server-post-receive-email-branches.sh index 0b35c61..b6b8f16 100644 --- a/tests/t2202-server-post-receive-email-branches.sh +++ b/tests/t2202-server-post-receive-email-branches.sh @@ -4,6 +4,8 @@ test_description='server post-receive email notification' . ./test-lib.sh +export USER=author + test_expect_success 'setup' ' echo "setup" >a && git add a && @@ -13,8 +15,8 @@ test_expect_success 'setup' ' 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 ' -- 2.39.5