--- /dev/null
+Return-Path: <too@guru.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 37482431E82\r
+ for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:17:37 -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 dAa0VgLeV4V5 for <notmuch@notmuchmail.org>;\r
+ Wed, 15 Feb 2012 01:17:35 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1898C431FBD\r
+ for <notmuch@notmuchmail.org>; Wed, 15 Feb 2012 01:17:35 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id B4C2A68056; Wed, 15 Feb 2012 11:17:36 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v7 1/3] test: add tests wrt ignoring user-specified files and\r
+ directories\r
+Date: Wed, 15 Feb 2012 11:17:30 +0200\r
+Message-Id: <1329297452-20852-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.6.1\r
+In-Reply-To: <1329297452-20852-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1315949524-4948-1-git-send-email-tomi.ollila@iki.fi>\r
+ <1329297452-20852-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: Tomi Ollila <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: Wed, 15 Feb 2012 09:17:37 -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
+This is basically Pieter's work with Austin's comments addressed.\r
+---\r
+ test/new | 22 ++++++++++++++++++++++\r
+ 1 files changed, 22 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/new b/test/new\r
+index 49f390d..e453684 100755\r
+--- a/test/new\r
++++ b/test/new\r
+@@ -153,4 +153,26 @@ rm -rf "${MAIL_DIR}"/two\r
+ output=$(NOTMUCH_NEW)\r
+ test_expect_equal "$output" "No new mail. Removed 3 messages."\r
+ \r
++# This test requires that notmuch new has been run at least once.\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
++touch "${MAIL_DIR}"/.git # change .git's mtime for notmuch new to rescan.\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.2\r
+\r