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 345F640D152 for ; Thu, 4 Nov 2010 11:35:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.89 X-Spam-Level: X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01] autolearn=ham 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 pfPl5wjAAIvC; Thu, 4 Nov 2010 11:35:47 -0700 (PDT) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 65F8C4196F0; Thu, 4 Nov 2010 11:35:47 -0700 (PDT) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 16BAD254102; Thu, 4 Nov 2010 11:35:47 -0700 (PDT) From: Carl Worth To: Rob Browning , notmuch@notmuchmail.org Subject: Re: Adding support for "notmuch new ... PATH" In-Reply-To: <87pqv096ec.fsf@raven.defaultvalue.org> References: <87pqv096ec.fsf@raven.defaultvalue.org> User-Agent: Notmuch/0.4 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 04 Nov 2010 11:35:41 -0700 Message-ID: <87aalpq6ma.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Thu, 04 Nov 2010 18:35:58 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Sat, 23 Oct 2010 12:16:11 -0500, Rob Browning wro= te: > I'm working on support for something like >=20 > notmuch new [--] [PATH ..] >=20 > where PATH can be any path (file or dir) within the mail directory, Hi Rob, Thanks for doing this work. I hope that it will prove useful. I know we've chatted about this work from time to time in the #notmuch IRC channel, (and the performance concerns you have that are motivating this work). Here's something thing to keep in mind as you consider an approach were you only add explicit files to the database: In addition to adding new messages, the "notmuch new" command is also responsible for identifying files that have been deleted from the filesystem and updating the database. So if you switched to explicit "notmuch new -- PATH" for adding new files, you'd still want to do something for deleted files, (perhaps a similar, explicit-path command for those as well?). > I had a couple of questions: >=20 > 1) What happens if you call notmuch_database_add_message() for a path > that's already in the database. Is that OK? It's certainly OK. You will get a return value of NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID for this. And the current code treats this as an "error", (in the sense that it will not give you a valid message object---that's reserved for a "successful return"). There's a proposed patch here: id:"1288560558-18915-2-git-send-email-sojkam1@fel.cvut.cz that changes this so that the DUPLICATE_MESSAGE_ID case is documented as a "successful return" and would also return a valid message object. And that patch will likely be landing soon. > 2) Does add_files_recursive() assume it always sees all paths? > i.e. is it safe to call it with just a sub-directory of the mail > directory? I haven't finished investigating the code, but some > bits made me wonder. From=20a quick scan of the code, I think this should be just fine. But do add tests to the suite (which you are doing already, right?). =2DCarl =2D-=20 carl.d.worth@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFM0vz96JDdNq8qSWgRAun3AJ9ZjQHOD3ZQeA/5q9fShNHxYZ0VCwCfSBrX R+S2JROPkl0Xj230MIzHAhU= =HYyX -----END PGP SIGNATURE----- --=-=-=--