--- /dev/null
+Return-Path: <too@guru-group.fi>\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 DA382431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 20 Jan 2013 19:02:02 -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 r7tV0NygbKtJ for <notmuch@notmuchmail.org>;\r
+ Sun, 20 Jan 2013 19:02:02 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id DA53F431FBD\r
+ for <notmuch@notmuchmail.org>; Sun, 20 Jan 2013 19:02:01 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 361B81000CF; Mon, 21 Jan 2013 05:01:51 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] test/test-lib.sh: separate signaled exit\r
+Date: Mon, 21 Jan 2013 05:01:46 +0200\r
+Message-Id: <1358737306-21744-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1358737306-21744-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <id:1358717493-11231-1-git-send-email-tomi.ollila@iki.fi>\r
+ <1358737306-21744-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: tomi.ollila@iki.fi\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, 21 Jan 2013 03:02:03 -0000\r
+\r
+When execution of tests is interrupted by signal coming outside of the\r
+test system itself, output just one line "interrupted by signal <num>"\r
+message to standard output. This distinguishes the case from internal\r
+exit and reduces noise.\r
+---\r
+ test/test-lib.sh | 15 ++++++++++++++-\r
+ 1 file changed, 14 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 0098bfd..e717c52 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -190,9 +190,15 @@ test_fixed=0\r
+ test_broken=0\r
+ test_success=0\r
+ \r
+-die () {\r
++_die_common () {\r
+ code=$?\r
++ trap - EXIT\r
++ set +ex\r
+ rm -rf "$TEST_TMPDIR"\r
++}\r
++\r
++die () {\r
++ _die_common\r
+ if test -n "$GIT_EXIT_OK"\r
+ then\r
+ exit $code\r
+@@ -206,10 +212,17 @@ die () {\r
+ fi\r
+ }\r
+ \r
++die_signal () {\r
++ _die_common\r
++ echo >&5 "FATAL: $0: interrupted by signal" $((code - 128))\r
++ exit $code\r
++}\r
++\r
+ GIT_EXIT_OK=\r
+ # Note: TEST_TMPDIR *NOT* exported!\r
+ TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX")\r
+ trap 'die' EXIT\r
++trap 'die_signal' HUP INT TERM\r
+ \r
+ test_decode_color () {\r
+ sed -e 's/.\[1m/<WHITE>/g' \\r
+-- \r
+1.8.0\r
+\r