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