--- /dev/null
+Return-Path: <pieter@praet.org>\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 91123431E64\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 06:15:12 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 MT4MKoD5XxI1 for <notmuch@notmuchmail.org>;\r
+ Wed, 1 Feb 2012 06:15:07 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+ [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id DB00A421192\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 06:15:06 -0800 (PST)\r
+Received: by wibhi8 with SMTP id hi8so995743wib.26\r
+ for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 06:15:05 -0800 (PST)\r
+Received: by 10.180.89.71 with SMTP id bm7mr11193882wib.20.1328105705643;\r
+ Wed, 01 Feb 2012 06:15:05 -0800 (PST)\r
+Received: from localhost ([109.131.39.11])\r
+ by mx.google.com with ESMTPS id t15sm45027118wiv.6.2012.02.01.06.15.04\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Wed, 01 Feb 2012 06:15:05 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Edmondson <dme@dme.org>, Tomi Ollila <tomi.ollila@iki.fi>,\r
+ David Bremner <david@tethera.net>\r
+Subject: [PATCH] test: add tests wrt ignoring user-specified files and\r
+ directories\r
+Date: Wed, 1 Feb 2012 15:12:53 +0100\r
+Message-Id: <1328105573-4626-1-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>\r
+References: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>\r
+Cc: Notmuch Mail <notmuch@notmuchmail.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: Wed, 01 Feb 2012 14:15:12 -0000\r
+\r
+Files and directories which are specified in 'new.ignore' in the\r
+config file shouldn't be indexed nor reported by `notmuch new'.\r
+\r
+---\r
+ test/new | 23 +++++++++++++++++++++++\r
+ 1 files changed, 23 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/new b/test/new\r
+index 49f390d..740ba05 100755\r
+--- a/test/new\r
++++ b/test/new\r
+@@ -153,4 +153,27 @@ rm -rf "${MAIL_DIR}"/two\r
+ output=$(NOTMUCH_NEW)\r
+ test_expect_equal "$output" "No new mail. Removed 3 messages."\r
+ \r
++test_begin_subtest "Skip and report non-mail files"\r
++generate_message\r
++mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config\r
++touch "${MAIL_DIR}"/ignored_file\r
++touch "${MAIL_DIR}"/.ignored_hidden_file\r
++output=$(NOTMUCH_NEW 2>&1)\r
++test_expect_equal "$output" \\r
++"Note: Ignoring non-mail file: ${MAIL_DIR}/.git/config\r
++Note: Ignoring non-mail file: ${MAIL_DIR}/.ignored_hidden_file\r
++Note: Ignoring non-mail file: ${MAIL_DIR}/ignored_file\r
++Added 1 new message to the database."\r
++\r
++test_begin_subtest "Ignore files and directories specified in new.ignore"\r
++test_subtest_known_broken\r
++generate_message\r
++notmuch config set new.ignore .git ignored_file .ignored_hidden_file\r
++mkdir -p "${MAIL_DIR}"/.git && touch "${MAIL_DIR}"/.git/config\r
++touch "${MAIL_DIR}"/ignored_file\r
++touch "${MAIL_DIR}"/.ignored_hidden_file\r
++output=$(NOTMUCH_NEW 2>&1)\r
++test_expect_equal "$output" "Added 1 new message to the database."\r
++\r
++\r
+ test_done\r
+-- \r
+1.7.8.1\r
+\r