summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-02 13:14:06 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2010-11-02 13:14:06 (GMT)
commit0b4a8634fce68406205377997538879b20748f21 (patch)
tree06ad578975db904b452ef1c333012c3ab53f48dc
parent9b8e02051a0cd1b6a80658a35a9dfa3946030204 (diff)
downloadtip-bot-0b4a8634fce68406205377997538879b20748f21.zip
tip-bot-0b4a8634fce68406205377997538879b20748f21.tar.gz
tip-bot-0b4a8634fce68406205377997538879b20748f21.tar.bz2
tip-bot-0b4a8634fce68406205377997538879b20748f21.tar.xz
Put in a failsafe trigger at 200 emails
-rwxr-xr-xrobot.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/robot.sh b/robot.sh
index 1adfb48..893d60e 100755
--- a/robot.sh
+++ b/robot.sh
@@ -46,11 +46,17 @@ date=$(date -uR)
NEW_HEAD=$(git rev-parse HEAD)
if [ x"$NEW_HEAD" != x"$OLD_HEAD" ]; then
- git rev-list --reverse --no-merges ^linus/master ^$OLD_HEAD $NEW_HEAD | (
+ git rev-list --reverse --no-merges ^linus/master ^$OLD_HEAD $NEW_HEAD > "$tmpdir"/revlist.$$
+ if [ $(wc -l "$tmpdir"/revlist.$$) -gt 200 ]; then
+ # Failsafe!
+ exit 1
+ fi
+ (
while read rev; do
"$topdir"/robotfmt.pl $rev "$topdir"/branches
done
- )
+ ) < "$tmpdir"/revlist.$$
+ rm -f "$tmpdir"/revlist.$$
fi
cd "$topdir"