[PATCH] test: another test wrt ignoring user-specified files and directories
authorEthan Glasser-Camp <ethan.glasser.camp@gmail.com>
Fri, 12 Oct 2012 19:32:38 +0000 (15:32 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:45 +0000 (09:49 -0800)
c0/bac538477108c08a2ef9e21a27c009ea4092bf [new file with mode: 0644]

diff --git a/c0/bac538477108c08a2ef9e21a27c009ea4092bf b/c0/bac538477108c08a2ef9e21a27c009ea4092bf
new file mode 100644 (file)
index 0000000..2e53eef
--- /dev/null
@@ -0,0 +1,110 @@
+Return-Path: <ethan.glasser.camp@gmail.com>\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 39DF6431FAF\r
+       for <notmuch@notmuchmail.org>; Fri, 12 Oct 2012 12:33:06 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 c7MamY-U+sGQ for <notmuch@notmuchmail.org>;\r
+       Fri, 12 Oct 2012 12:33:05 -0700 (PDT)\r
+Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com\r
+       [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8B5B8431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 12 Oct 2012 12:33:05 -0700 (PDT)\r
+Received: by mail-qa0-f53.google.com with SMTP id s11so128327qaa.5\r
+       for <notmuch@notmuchmail.org>; Fri, 12 Oct 2012 12:33:04 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=c2fJdbyc2jGvijfi07KBncel1UkTHtNk1BlqcDQnr3o=;\r
+       b=OT60R7mB8NTlbSy/Yw1+/DpQnX5/dkdTESuDmES+Or//V6UU09mmAcFEjD5Y3WQhEg\r
+       Q9JTZZ9vmBbxSDVd9GkLzMuCGer1T6Y6KLvbfkziavGHiZFErD6U2r7QTsEH1h9NjiJ+\r
+       3UCWv9GFeNieBUor1PWXiSkVZ43hYXj0nqY+rx1XBg3cVqUazpCwcLH7S8yHMfXeS7cO\r
+       ieQLwVF74acTsVfuFzSkpHvXZ9KWOqOzacXNTUWjMcQNQ7hcwZf9ECPL/TA2MH4vf0Ah\r
+       Xqe93BUmy2U3GAYNP+LfdxTQ3yx1V0sbD+gNg50d4+uM6BLPa8wUTDHI+xbCgAD8BGsx\r
+       D9NA==\r
+Received: by 10.49.104.129 with SMTP id ge1mr11818031qeb.62.1350070384878;\r
+       Fri, 12 Oct 2012 12:33:04 -0700 (PDT)\r
+Received: from smtp.gmail.com (p70-80.acedsl.com. [66.114.70.80])\r
+       by mx.google.com with ESMTPS id o10sm7991810qaj.14.2012.10.12.12.33.01\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 12 Oct 2012 12:33:03 -0700 (PDT)\r
+From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: another test wrt ignoring user-specified files and\r
+       directories\r
+Date: Fri, 12 Oct 2012 15:32:38 -0400\r
+Message-Id: <1350070358-28445-1-git-send-email-ethan@betacantrips.com>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <87d326dat6.fsf@zancas.localnet>\r
+References: <87d326dat6.fsf@zancas.localnet>\r
+Cc: Ethan Glasser-Camp <ethan@betacantrips.com>,\r
+       Pieter Praet <pieter@praet.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, 12 Oct 2012 19:33:06 -0000\r
+\r
+From: Pieter Praet <pieter@praet.org>\r
+\r
+Demonstrates that *every* file/directory which matches one of the values\r
+in 'new.ignore' will be ignored, independent of its depth/location in\r
+the mail store.\r
+\r
+Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>\r
+---\r
+This is the trivial modification of Pieter's patch that makes it work\r
+no matter where your test directory is.\r
+\r
+ test/new |   19 +++++++++++++++++++\r
+ 1 file changed, 19 insertions(+)\r
+\r
+diff --git a/test/new b/test/new\r
+index cab7c01..cc2af72 100755\r
+--- a/test/new\r
++++ b/test/new\r
+@@ -183,5 +183,24 @@ 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
++test_begin_subtest "Ignore files and directories specified in new.ignore (multiple occurrences)"\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
++mkdir -p "${MAIL_DIR}"/one/two/three/.git\r
++notmuch new > /dev/null # ensure that files/folders will be printed in ASCII order.\r
++touch "${MAIL_DIR}"/{one,one/two,one/two/three}/ignored_file\r
++output=$(NOTMUCH_NEW --debug 2>&1)\r
++test_expect_equal "$output" \\r
++"(D) add_files_recursive, pass 1: explicitly ignoring ${MAIL_DIR}/.git\r
++(D) add_files_recursive, pass 1: explicitly ignoring ${MAIL_DIR}/one/two/three/.git\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/.git\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/three/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/two/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/one/ignored_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file\r
++(D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file\r
++No new mail."\r
++\r
\r
+ test_done\r
+-- \r
+1.7.9.5\r
+\r