Re: [PATCH] test: add tests wrt ignoring user-specified files and directories
authorPieter Praet <pieter@praet.org>
Sun, 19 Feb 2012 20:43:56 +0000 (21:43 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:42 +0000 (09:44 -0800)
0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 [new file with mode: 0644]

diff --git a/0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322 b/0c/9f8b5f1399ad381e9b4ce59c7af2920bd4a322
new file mode 100644 (file)
index 0000000..7b7fdf6
--- /dev/null
@@ -0,0 +1,148 @@
+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 7C3BC431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 12:46:17 -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 76eFsLdjf3pg for <notmuch@notmuchmail.org>;\r
+       Sun, 19 Feb 2012 12:46:16 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ ADF76431FAE   for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 12:46:16 -0800\r
+ (PST)\r
+Received: by wgbdt12 with SMTP id dt12so4006676wgb.2\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Feb 2012 12:46:15 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
+       10.180.80.35 as permitted sender) client-ip=10.180.80.35; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of pieter@praet.org\r
+       designates 10.180.80.35 as permitted sender)\r
+       smtp.mail=pieter@praet.org\r
+Received: from mr.google.com ([10.180.80.35])\r
+       by 10.180.80.35 with SMTP id o3mr12084970wix.5.1329684375468 (num_hops\r
+       = 1); Sun, 19 Feb 2012 12:46:15 -0800 (PST)\r
+Received: by 10.180.80.35 with SMTP id o3mr10080859wix.5.1329684372425;\r
+       Sun, 19 Feb 2012 12:46:12 -0800 (PST)\r
+Received: from localhost (104.218-242-81.adsl-dyn.isp.belgacom.be.\r
+       [81.242.218.104])\r
+       by mx.google.com with ESMTPS id dw7sm11421772wib.4.2012.02.19.12.46.11\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 19 Feb 2012 12:46:11 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Austin Clements <amdragon@MIT.EDU>, 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: <874nv7wn88.fsf@awakening.csail.mit.edu>\r
+References: <cunr4yonvn4.fsf@hotblack-desiato.hh.sledj.net>\r
+       <1328105573-4626-1-git-send-email-pieter@praet.org>\r
+       <874nv7wn88.fsf@awakening.csail.mit.edu>\r
+User-Agent: Notmuch/0.11.1+210~g6afc43e (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Sun, 19 Feb 2012 21:43:56 +0100\r
+Message-ID: <87linysgdv.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQnZbiN+ML5alp2ubiMs57AJpRleKM6aW+6YzauYVpfpgy1TI+Eh+xE8uv+ZBaypQq2gwy+1\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: Sun, 19 Feb 2012 20:46:17 -0000\r
+\r
+On Fri, 03 Feb 2012 17:44:55 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\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
+\r
+Good point.\r
+\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
+\r
+Those are/were intended to keep the test self-contained (i.e.\r
+independent of the previous one).  Probably should've added a\r
+comment about that.\r
+\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
+\r
+Thanks for reviewing!\r
+\r
+Peace\r
+\r
+\r
+-- \r
+Pieter\r