Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing a database handle
authorJani Nikula <jani@nikula.org>
Tue, 3 Dec 2013 17:22:32 +0000 (19:22 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:58:35 +0000 (09:58 -0800)
e5/f100a6caab0cbeff7186a2ebf74119ab168cc9 [new file with mode: 0644]

diff --git a/e5/f100a6caab0cbeff7186a2ebf74119ab168cc9 b/e5/f100a6caab0cbeff7186a2ebf74119ab168cc9
new file mode 100644 (file)
index 0000000..b5a2003
--- /dev/null
@@ -0,0 +1,127 @@
+Return-Path: <jani@nikula.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 1959D431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Dec 2013 09:49:58 -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 KEmOenC+uRLl for <notmuch@notmuchmail.org>;\r
+       Tue,  3 Dec 2013 09:49:50 -0800 (PST)\r
+Received: from mail-la0-f51.google.com (mail-la0-f51.google.com\r
+       [209.85.215.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 96F61431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Dec 2013 09:49:50 -0800 (PST)\r
+Received: by mail-la0-f51.google.com with SMTP id ec20so9463694lab.10\r
+       for <notmuch@notmuchmail.org>; Tue, 03 Dec 2013 09:49:47 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+       :user-agent:date:message-id:mime-version:content-type;\r
+       bh=SKyJ7+c36w74ZEdLoL2xvX9RPwmgJKkg/UeYW4I9hTA=;\r
+       b=ZSVFOOMzGZbPnGvbScXairOo9K9H1c3NX3NKObfJVIkVwUIsb3hYy4QZ6IDgz4yU5q\r
+       38It0o7m1uI4TdHkRReG+hQ7Fn7Um6AMKmDK3qALRyiVe/G7JRopiBDnW/MLo0ORwaxI\r
+       swlX5XY8XjoDmXTWDPGtgPwFDWv9k652cWYE6fLgUktjQSLdv1mMrjgd5YAaYh+Je6fZ\r
+       HPLvuRhUNS+baBa+TmfCfWsrRCefxdPtvYdXRh+9C3vMH0HYq6xLTG3pHsEyZ2ih0SYu\r
+       8T210Es5dnl+fwwYb2u3pAZ/Y1++dOTAgM/XCjAPCtTF67Lz/SFT2vIqE0nl8nZCI4+g\r
+       NJTg==\r
+X-Gm-Message-State:\r
+ ALoCoQkueIEaWzHUWsE7lMZHiwSPa+TojWDoSN6AgasM9KqRHW/m8PHTdT/hs5/BDMGC3gQn2UQ1\r
+X-Received: by 10.152.19.65 with SMTP id c1mr2218509lae.49.1386091358161;\r
+       Tue, 03 Dec 2013 09:22:38 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91]) by mx.google.com with ESMTPSA id\r
+       np10sm43623413lbb.7.2013.12.03.09.22.36 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 03 Dec 2013 09:22:37 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing\r
+       a database handle\r
+In-Reply-To: <87wqjm2m2q.fsf@zancas.localnet>\r
+References: <cover.1385903109.git.jani@nikula.org>\r
+       <fc7ecd990e55fcfba17de4d71e8823c98760f9ce.1385903109.git.jani@nikula.org>\r
+       <87wqjm2m2q.fsf@zancas.localnet>\r
+User-Agent: Notmuch/0.16+145~gebbaa94 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Tue, 03 Dec 2013 19:22:32 +0200\r
+Message-ID: <874n6pyhlz.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Tue, 03 Dec 2013 17:49:58 -0000\r
+\r
+On Tue, 03 Dec 2013, David Bremner <david@tethera.net> wrote:\r
+> The first patch looks ok. I like the new API overall.\r
+\r
+Happy to hear that.\r
+\r
+> As far as breaking contrib/notmuch-deliver, I'd rather fix\r
+> notmuch-insert than put effort into notmuch-deliver at this point. I\r
+> guess it could be a rough transition for people running notmuch-deliver\r
+> from git.\r
+\r
+Agreed. We could fix notmuch insert with patch 1/2 alone.\r
+\r
+> Jani Nikula <jani@nikula.org> writes:\r
+>\r
+>> +/*\r
+>> + * XXX: error handling should clean up *all* state created!\r
+>> + */\r
+> is this a warning to future hackers or some current problem?\r
+\r
+It's a note to self and reviewers that we need to be sure this\r
+happens... I'm just saying I'm not 100% sure we're doing all of that\r
+now.\r
+\r
+>>  notmuch_status_t\r
+>> -notmuch_database_open (const char *path,\r
+>> -                  notmuch_database_mode_t mode,\r
+>> -                  notmuch_database_t **database)\r
+>> +notmuch_database_open (notmuch_database_t *notmuch, const char *path,\r
+>> +                  notmuch_database_mode_t mode)\r
+>>  \r
+>> +/* Initialize a new, empty database handle.\r
+>> + *\r
+>\r
+> I wondered about making the new documentation adhere to doxygen?\r
+\r
+I was thinking of fixing either series depending on them getting\r
+merged. I wasn't sure we'd reached consensus on doxygen yet.\r
+\r
+>> +    if (notmuch_database_open (notmuch,\r
+>> +                          notmuch_config_get_database_path (config),\r
+>> +                          NOTMUCH_DATABASE_MODE_READ_ONLY))\r
+>\r
+> Would it make any sense to migrate the mode argument to an option\r
+> setting while we're messing with the API?  \r
+\r
+My gut feeling says no. Same for the path argument suggested by Tomi.\r
+\r
+What would it mean to change the mode while the database is open? Or the\r
+path? I think we'd have to check for this, and fail. Mode is only\r
+meaningful for open, and path for open, create and compact. I think\r
+adding such state modifiers would make the interface feel more complex,\r
+but I'm open to arguments to the contrary.\r
+\r
+\r
+BR,\r
+Jani.\r