#!/bin/bash # AUTHOR: Daniel Browning # NAME: test-email-hook - Tests the custom git e-mail hook # SYNOPSIS: ./test-email-hook # DESCRIPTION: Perform a variety of actions to test how the e-mails look. # The first argument specifies the To: address for the test e-mails. # Stop of error set -o errexit rm -Rf test-email-hook-files mkdir test-email-hook-files cd test-email-hook-files TEST_EMAIL=$1 IC_REPO=$2 if [ "$TEST_EMAIL" == "" ]; then echo echo 'Usage: test-email-hook ' echo exit -1 fi if [ "$IC_REPO" == "" ]; then echo echo 'Usage: test-email-hook ' echo exit -1 fi echo 'Clone interchange repo...' git clone $IC_REPO prep-interchange/ cd prep-interchange/ # Pull out a few commits for applying later. git format-patch 0fbf0b654901ec4d1258b5a743f413e5ce32c4a9^..ba0d8b7d2d9692e2d60ac536c73fe52b966f56ec git format-patch bcf1ee92ace67afe84ee7ce96abad9809d98aeaa^..53fc12a54d21a5ca4e8e0f8553a432266673ad6b # Go back in time. git reset --hard 0fbf0b654901ec4d1258b5a743f413e5ce32c4a9^ cd .. git clone --bare prep-interchange interchange mv prep-interchange/*.patch ./ rm -Rf prep-interchange # Add the gnome mailer cd interchange/hooks/ wget http://icdevgroup.org/~danb/git-email-hook/post-receive-email chmod a+x post-receive-email wget http://icdevgroup.org/~danb/git-email-hook/git.py wget http://icdevgroup.org/~danb/git-email-hook/util.py ln -s post-receive-email post-receive cd .. git config --add hooks.mailinglist $TEST_EMAIL git config --add hooks.fromaddress interchange-cvs@icdevgroup.org git config --add hooks.replyto interchange-core@icdevgroup.org # git config --remove-section hooks # git config --add hooks.fromuser interchange-cvs # git config --add hooks.fromdomain icdevgroup.org cd .. git clone interchange camp20 mv *.patch camp20 cd camp20 # Show that two commits pushed together show up as separate e-mails. git am 0001-Unbuffer-output-as-early-as-possible.patch git am 0002-Specifically-require-Digest-SHA1-module.patch git push origin master #echo 'done pushing those two changes. Taking a break before creating branch...' #sleep 10s; #echo 'now creating branch' # Create STABLE_5_6-branch based on current master git checkout -b STABLE_5_6-branch git push origin STABLE_5_6-branch git checkout master git am 0003-Correct-detection-of-broken-getppid-for-Perl-5.10.patch git push origin master git checkout STABLE_5_6-branch git merge master git push origin STABLE_5_6-branch git checkout master git am 0009-ISBN-check-can-be-advised-to-accept-ISBN-10-or-ISBN.patch git push origin master git am 0010-Abort-daemon-startup-when-required-module-is-missing.patch git push origin master