Re: [PATCH 2/2] added support for user-specified directories to exclude
authorAustin Clements <amdragon@MIT.EDU>
Fri, 27 Jan 2012 22:14:04 +0000 (17:14 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:25 +0000 (09:43 -0800)
68/9e7e098d6db02973cd967cc300c4c703b7eabc [new file with mode: 0644]

diff --git a/68/9e7e098d6db02973cd967cc300c4c703b7eabc b/68/9e7e098d6db02973cd967cc300c4c703b7eabc
new file mode 100644 (file)
index 0000000..ae71dc7
--- /dev/null
@@ -0,0 +1,150 @@
+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 842CC431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 14:14:51 -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 4m2Jle9prqmJ for <notmuch@notmuchmail.org>;\r
+       Fri, 27 Jan 2012 14:14:50 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
+       [18.7.68.35])\r
+       by olra.theworths.org (Postfix) with ESMTP id 5ECDA431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 14:14:50 -0800 (PST)\r
+X-AuditID: 12074423-b7f9c6d0000008c3-7e-4f2321d815fe\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 4D.5A.02243.8D1232F4; Fri, 27 Jan 2012 17:14:48 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0RMEl1w009659; \r
+       Fri, 27 Jan 2012 17:14:48 -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 q0RMEkZp014901\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Fri, 27 Jan 2012 17:14:47 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Rqu3Y-0004Y4-DA; Fri, 27 Jan 2012 17:14:04 -0500\r
+Date: Fri, 27 Jan 2012 17:14:04 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>\r
+Subject: Re: [PATCH 2/2] added support for user-specified directories to\r
+       exclude\r
+Message-ID: <20120127221404.GB10053@mit.edu>\r
+References: <8762g0sj6f.fsf@praet.org>\r
+       <1327572718-13411-1-git-send-email-tomi.ollila@iki.fi>\r
+       <1327572718-13411-2-git-send-email-tomi.ollila@iki.fi>\r
+       <87pqe6ip6f.fsf@nikula.org> <m2fwf1jult.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <m2fwf1jult.fsf@guru.guru-group.fi>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42IRYrdT0b2hqOxvsPC9tUXTdGeL6zdnMlu8\r
+       WTmP1YHZ4/DXhSwet+6/Zvd4tuoWcwBzFJdNSmpOZllqkb5dAldG06R+1oJnkhW3rys3MK4T\r
+       6WLk5JAQMJG42jmdBcIWk7hwbz1bFyMXh5DAPkaJgyv2MUM4Gxgl/my6yQZSJSRwkkmi55YV\r
+       RGIJo8SkjoNMIAkWAVWJ7rMHwEaxCWhIbNu/nBHEFhFQkXjQtp4VxGYWsJJo2PIBKM7BISwQ\r
+       JPHmEjOIySugI9H4TRhi5B1GiVWnDoOV8woISpyc+YQFolVL4sa/l0wg9cwC0hLL/3GAhDkF\r
+       DCQ65k5nB7FFgTZNObmNbQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI\r
+       10wvN7NELzWldBMjOMhdlHcw/jmodIhRgINRiYf3wislfyHWxLLiytxDjJIcTEqivNzAGBHi\r
+       S8pPqcxILM6ILyrNSS0+xCjBwawkwnvHS9FfiDclsbIqtSgfJiXNwaIkzquh9c5PSCA9sSQ1\r
+       OzW1ILUIJivDwaEkwRsKMlSwKDU9tSItM6cEIc3EwQkynAdoeDZIDW9xQWJucWY6RP4Uo6KU\r
+       OG8xSEIAJJFRmgfXC0tCrxjFgV4R5i0AqeIBJjC47ldAg5mABkdcBbm6uCQRISXVwHj9stUL\r
+       u/Vn/y7RPJGXWnVilmJqV4ZL9mEtjh3n7FhVchyXCE0odr0omnl7++X+pKq+s4vl7fnr7x5j\r
+       z10usnOGSXVbCbeDW577elfVO1Y/j58w9zq6RZbN4FmkfIjGVb0b+5Yw2+lVNbklls466crl\r
+       qyjo4i03+fWyg/H1LM6rWP8ukzSZosRSnJFoqMVcVJwIAACyRmwdAwAA\r
+Cc: 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, 27 Jan 2012 22:14:51 -0000\r
+\r
+Quoth Tomi Ollila on Jan 27 at 12:41 pm:\r
+> On Thu, 26 Jan 2012 13:11:36 +0000, Jani Nikula <jani@nikula.org> wrote:\r
+> > On Thu, 26 Jan 2012 12:11:58 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> > > A new configuration key 'database.exclude' is used to determine\r
+> > > which directories user wants not to be scanned for new mails.\r
+> > > \r
+> > > ---\r
+> > > \r
+> > > Notes (from 2011-09-13):\r
+> > > \r
+> > > 1) Currently the comments for newly created configuration file are not\r
+> > > updated, so for not this is 'undocumented feature'. Should there be an\r
+> > > empty configuration line as a placeholder ... ?\r
+> > > \r
+> > > 2) Whenever some already existing directory is added to the exclude list\r
+> > > and the parent directory timestamp has not changed, notmuch new will not\r
+> > > notice the directory has gone (as it still is there), user needs to 'touch'\r
+> > > the parent directory before next 'notmuch new' no make notmuch notice.\r
+> > > \r
+> > > 2012-01-26: could notmuch track mtime of the configuration file and if\r
+> > > that changes, ignore mail directory timestamps ?\r
+> > > \r
+> > > 3) count_files() function is not touched. The functionality there has fallen\r
+> > > behind of add_files_recursive (maildir+tmp check and following symlinks).\r
+> > > The question there should it be updated, or attempted to merge with\r
+> > > add_files (as the comment says). count_files() is only called at the beginning\r
+> > > when database is not yet initialised.\r
+> > > ---\r
+> \r
+> [ ... ]\r
+> \r
+> > > +        /* Ignore user-specified directories */\r
+> > > +        for (j = 0; j < state->database_exclude_length; j++)\r
+> > > +            if (strcmp(entry->d_name, state->database_exclude[j]) == 0)\r
+> > > +                break;\r
+> > > +        if (j < state->database_exclude_length)\r
+> > > +            continue;\r
+> > \r
+> > How about wrapping that in a function you can use here and below?\r
+> > \r
+> >    if (user_wants_this_excluded (...))\r
+> >            continue;\r
+> \r
+> Good point....\r
+> \r
+> > Please also have a look at id:"87pqecylon.fsf@nikula.org" and the\r
+> > patches Austin posted. "Auto ignore"?\r
+> \r
+> I personally don't mind auto ignore -- I even like the system yells about\r
+> those 3 files I forgot to add to ignore list every now and then (when the\r
+> mtime of the directory those are located changes). This is also something\r
+> different -- I can start keeping my drafts and spam directories alongside\r
+> other mail directories (or folders is you want to use that term).\r
+\r
+The allure of auto ignore is that you don't have to do anything to use\r
+it, but it's much less powerful than explicit ignores.  I think having\r
+both mechanisms would be overkill and I would use explicit ignores in\r
+preference to auto ignore.\r
+\r
+> Thanks for that id: it refers thread starting from id:"ylp7hi23mw8.fsf@tyndall.ie" \r
+> ( http://notmuchmail.org/pipermail/notmuch/2010/003145.html )\r
+> \r
+> and the patch there is somewhat more complete (although old rebase-wise). \r
+> It's easy to combine works together, but more difficult is to choose best \r
+> terminology: database.exclude vs. new.ignore (or something in between or \r
+> totally different). Ideas anyone?\r
+\r
+I would weigh in on the side of new.ignore, or at least something\r
+under [new].  This option fits better with the existing option in\r
+[new] than it does with the existing option in [database].\r