--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5D31F431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 24 Dec 2012 05:47:47 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id CZNhqIcdADMD for <notmuch@notmuchmail.org>;\r
+ Mon, 24 Dec 2012 05:47:46 -0800 (PST)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+ (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id D1199431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 24 Dec 2012 05:47:46 -0800 (PST)\r
+Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+ ([156.34.82.78] helo=zancas.localnet)\r
+ by tesseract.cs.unb.ca with esmtpsa\r
+ (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1Tn8Nb-0000RI-Cx; Mon, 24 Dec 2012 09:47:43 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1Tn8NV-0006l0-Kp; Mon, 24 Dec 2012 09:47:37 -0400\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] devel: add script to run tests on a patch series.\r
+Date: Mon, 24 Dec 2012 09:47:33 -0400\r
+Message-Id: <1356356853-25746-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Spam_bar: -\r
+Cc: David Bremner <bremner@debian.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 24 Dec 2012 13:47:47 -0000\r
+\r
+From: David Bremner <bremner@debian.org>\r
+\r
+This script is a thin wrapper around git rebase --interactive, that\r
+allows the user to fine tune patches if they break the test suite, or\r
+violate the coding style guidelines.\r
+\r
+The user can always run "git rebase --continue" to ignore false positives.\r
+\r
+I decided to use perl because inplace editing with sed is non-portable.\r
+---\r
+\r
+I have caught several formatting violations and at least one real bug \r
+using this as "last step before sending to the list".\r
+\r
+No doubt the more talented shell-scripters / perl-hackers in the crowd\r
+can can suggest some improvements.\r
+\r
+ devel/check-commit | 10 ++++++++++\r
+ devel/check-series | 33 +++++++++++++++++++++++++++++++++\r
+ 2 files changed, 43 insertions(+)\r
+ create mode 100755 devel/check-commit\r
+ create mode 100755 devel/check-series\r
+\r
+diff --git a/devel/check-commit b/devel/check-commit\r
+new file mode 100755\r
+index 0000000..86648b8\r
+--- /dev/null\r
++++ b/devel/check-commit\r
+@@ -0,0 +1,10 @@\r
++# This script is mainly intended to be used by the check-series script\r
++# but you are welcome to use it as a standalone tool. It takes no\r
++# parameters and operates on the latest git commit (HEAD).\r
++\r
++set -e\r
++make test\r
++for file in $(git diff --name-only HEAD^ | grep '[.]\(c\|h\|cc\|hh\)'); do\r
++ uncrustify --replace -c devel/uncrustify.cfg $file\r
++done\r
++git diff --quiet\r
+diff --git a/devel/check-series b/devel/check-series\r
+new file mode 100755\r
+index 0000000..d48e70f\r
+--- /dev/null\r
++++ b/devel/check-series\r
+@@ -0,0 +1,33 @@\r
++#/bin/sh\r
++\r
++# Usage: check-series [upstream-commit]\r
++\r
++# Checks each commit in a patch series (topic branch) by running the\r
++# script devel/check-commit. If check-commit fails (exits with\r
++# non-zero status), the user is left in the middle of a git rebase, and\r
++# can fix the commit, e.g. using git commit --amend, followed by\r
++# "git rebase --continue". If all else fails, "git rebase --abort" should\r
++# get you back to where you started.\r
++#\r
++# NOTE: this runs "make test" many times, so it can take a while.\r
++#\r
++\r
++trap cleanup EXIT\r
++\r
++cleanup () {\r
++ if [ -n "$tmpdir" ]; then\r
++ rm -rf $tmpdir\r
++ fi\r
++}\r
++\r
++upstream=master\r
++if [ -n "$1" ]; then\r
++ upstream="$1"\r
++fi\r
++\r
++# make sure we always run the most recent version of check-commit\r
++# in particular cope with it going away.\r
++tmpdir=$(mktemp -d)\r
++cp devel/check-commit $tmpdir\r
++\r
++GIT_SEQUENCE_EDITOR="perl -pi -e 's,^\s*([^#\s].*)$,\1\nexec $tmpdir/check-commit,'" git rebase -i $upstream\r
+-- \r
+1.7.10.4\r
+\r