summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-09 22:13:08 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2010-11-09 22:13:08 (GMT)
commit2ec5ba0c9bbbb467e18f52432487e673eca7963f (patch)
tree642be5a65930d92858f7089d2f6fc97cdbc02900
parent567bed560a208f266a56a9379cfab0feebf0f988 (diff)
downloadtip-bot-2ec5ba0c9bbbb467e18f52432487e673eca7963f.zip
tip-bot-2ec5ba0c9bbbb467e18f52432487e673eca7963f.tar.gz
tip-bot-2ec5ba0c9bbbb467e18f52432487e673eca7963f.tar.bz2
tip-bot-2ec5ba0c9bbbb467e18f52432487e673eca7963f.tar.xz
Send email on failsafe trigger
-rwxr-xr-xrobot.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/robot.sh b/robot.sh
index 9ed7940..380c98d 100755
--- a/robot.sh
+++ b/robot.sh
@@ -47,9 +47,19 @@ date=$(date -uR)
if [ x"$NEW_HEAD" != x"$OLD_HEAD" ]; then
git rev-list --reverse --no-merges ^linus/master ^$OLD_HEAD $NEW_HEAD > "$tmpdir"/revlist.$$
- if [ $(wc -l < "$tmpdir"/revlist.$$) -gt 200 ]; then
+ count=$(wc -l < "$tmpdir"/revlist.$$)
+ if [ $count -gt 100 ]; then
# Failsafe!
git reset --hard $OLD_HEAD
+ cat > "$tmpdir"/failsafe.$$ <<EOF
+From: tip-bot alert <hpa@git.kernel.org>
+To: H. Peter Anvin <hpa@zytor.com>
+Subject: tip-bot failsafe: $count emails
+
+Trying to send $count emails, reverting to $OLD_HEAD
+EOF
+ sendmail -i -t -O DeliveryMode=b < "$tmpdir"/failsafe.$$
+ rm -f "$tmpdir"/failsafe.$$
exit 1
fi
(