Re: [PATCH] test: add tests wrt ignoring user-specified files and directories
authorAustin Clements <amdragon@MIT.EDU>
Fri, 3 Feb 2012 22:44:55 +0000 (17:44 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:02 +0000 (09:44 -0800)
c3/738aa1e2afcb9fbeacf5279f68a4dd389124cc [new file with mode: 0644]

diff --git a/c3/738aa1e2afcb9fbeacf5279f68a4dd389124cc b/c3/738aa1e2afcb9fbeacf5279f68a4dd389124cc
new file mode 100644 (file)
index 0000000..61bd843
--- /dev/null
@@ -0,0 +1,137 @@
+Return-Path: <amdragon@mit.edu>\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 D51C8431FAF\r
+       for <notmuch@notmuchmail.org>; Fri,  3 Feb 2012 14:46:02 -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 x8RKZAZeZk3v for <notmuch@notmuchmail.org>;\r
+       Fri,  3 Feb 2012 14:46:02 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 32C4F431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  3 Feb 2012 14:46:02 -0800 (PST)\r
+X-AuditID: 1209190d-b7fbf6d0000008ba-5c-4f2c63a98d0d\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id F3.E0.02234.9A36C2F4; Fri,  3 Feb 2012 17:46:01 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q13Mk0vO009754; \r
+       Fri, 3 Feb 2012 17:46:00 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q13MjweI019606\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Fri, 3 Feb 2012 17:45:59 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1RtRsG-0001en-1i; Fri, 03 Feb 2012 17:44:56 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Pieter Praet <pieter@praet.org>, David Edmondson <dme@dme.org>,\r
+       Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] test: add tests wrt ignoring user-specified files and\r
+       directories\r
+In-Reply-To: <1328105573-4626-1-git-send-email-pieter@praet.org>\r
+References: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>\r
+       <1328105573-4626-1-git-send-email-pieter@praet.org>\r
+User-Agent: Notmuch/0.11+118~g220ee2c (http://notmuchmail.org) Emacs/23.3.1\r
+       (i486-pc-linux-gnu)\r
+Date: Fri, 03 Feb 2012 17:44:55 -0500\r
+Message-ID: <874nv7wn88.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42IR4hRV1l2ZrONvMOetnsWN1m5Gi313tjBZ\r
+       XL85k9ni9+sbzBZvVs5jdWD12PX8L5PH4a8LWTyerbrF7NGx7zKrx5ZD75kDWKO4bFJSczLL\r
+       Uov07RK4MlZ/esRW0C1YceTJf6YGxuV8XYycHBICJhIdO3uZIGwxiQv31rN1MXJxCAnsY5T4\r
+       uL+JHcJZzyjxtvkgI4RzgkniSfMCVghnCaPEl/NTmUH62QQ0JLbtXw5WJSIwgVGi+dscNpAE\r
+       s4CWxNaNHxhBbGGBMIlXW1vBGjgFHCSeNDawg9hCAvkSX169YQGxRQXiJe7MXQnWyyKgKrHu\r
+       5yOgOAcHL9Cxhxu5QMK8AoISJ2c+YYEZf+PfS6YJjIKzkKRmIUktYGRaxSibklulm5uYmVOc\r
+       mqxbnJyYl5dapGukl5tZopeaUrqJERzokrw7GN8dVDrEKMDBqMTDu0FPx1+INbGsuDL3EKMk\r
+       B5OSKG9QAlCILyk/pTIjsTgjvqg0J7X4EKMEB7OSCK+VOlCONyWxsiq1KB8mJc3BoiTOq6r1\r
+       zk9IID2xJDU7NbUgtQgmK8PBoSTBywiMaCHBotT01Iq0zJwShDQTByfIcB6g4RIgNbzFBYm5\r
+       xZnpEPlTjIpS4rwiIAkBkERGaR5cLywRvWIUB3pFmFcOpIoHmMTgul8BDWYCGsxgoQkyuCQR\r
+       ISXVwBj+X6xq64k9u9R3VEqfqoq9nednL/YjxsdlS/TcP9+qhO7x/pwd6mLyZkV16Yfv/I5C\r
+       HTbeiyRig/YViInlrwyJV12x64DvVu8zCVl39vy+++zCieK59mbaLY0VrPNr0m9v3bTsIWPH\r
+       D4fmywGmR1SSfTgqMzo2r7Fu+KAY1Zko9yxaaPa3OCWW4oxEQy3mouJEALfHTTkfAwAA\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: Fri, 03 Feb 2012 22:46:03 -0000\r
+\r
+On Wed,  1 Feb 2012 15:12:53 +0100, Pieter Praet <pieter@praet.org> wrote:\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
+\r
+This doesn't change .git's mtime, so notmuch new may not scan it (*may*\r
+not because it's possible/likely notmuch refused to record the mtime in\r
+the above test on account of lack of granularity).  Probably you should\r
+just touch "${MAIL_DIR}"/.git.  Or maybe touch a new file under it.\r
+\r
+> +touch "${MAIL_DIR}"/ignored_file\r
+> +touch "${MAIL_DIR}"/.ignored_hidden_file\r
+\r
+These aren't necessary since these files already exist and they won't\r
+touch the directory's mtime (though the generate_message will).\r
+\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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+> \r