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

diff --git a/73/4ed673f9ed2a0d8d832fdd58ec741cc745ffcc b/73/4ed673f9ed2a0d8d832fdd58ec741cc745ffcc
new file mode 100644 (file)
index 0000000..0f2b5bb
--- /dev/null
@@ -0,0 +1,142 @@
+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 AD88A431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Dec 2013 09:29:42 -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 MciZTFxFf+oi for <notmuch@notmuchmail.org>;\r
+       Tue,  3 Dec 2013 09:29:32 -0800 (PST)\r
+Received: from mail-la0-f49.google.com (mail-la0-f49.google.com\r
+       [209.85.215.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6B83B431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  3 Dec 2013 09:29:32 -0800 (PST)\r
+Received: by mail-la0-f49.google.com with SMTP id er20so9127527lab.22\r
+       for <notmuch@notmuchmail.org>; Tue, 03 Dec 2013 09:29:30 -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=AyxMUfch6hzCTdfTip7ttrxAP1UixqxujwYXYX6qSUo=;\r
+       b=C7ua/2jP7txnbeVwxQVtMR+6saU3sbDaRem+/O9kVMbla3qRoqs2WTIvti4BTBrXZR\r
+       vqtBAjdrDWCOYIqRdHaRmd1sUnBuWx8HSXkokRgQka4ERbF37pkLpjkHJCiVUxkBwVrL\r
+       brP8Ld5MaP27I4vvrpXVziDh87stVf5e0Va7OEnh2nJ8cE8SoDUq/vORzlKSSQnDU8qW\r
+       Af1HDVH163TZHRaWAVVMRRgjG6BAyypAjZoLIcmZg4EDP9qRNMvSjNhLv1LQzFGhzE/h\r
+       OpNym0Wnijs+FkC6YBvAb1jfJ0Imdam/zMoufuDQ0INyPK1m8h2EbGWZRHjst2GgyLRz\r
+       3iQg==\r
+X-Gm-Message-State:\r
+ ALoCoQkc00zllFj9997RNzx/8ISf2CDEJbJ5VjyUsBxOYmfQzfJs2zVGodFHIr1KixA7NB4AGerB\r
+X-Received: by 10.152.242.8 with SMTP id wm8mr76322lac.76.1386091770646;\r
+       Tue, 03 Dec 2013 09:29:30 -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
+       ld10sm17458298lab.8.2013.12.03.09.29.28 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Tue, 03 Dec 2013 09:29:29 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>,\r
+       notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/2] lib: introduce notmuch_database_new for initializing\r
+       a database handle\r
+In-Reply-To: <m2iov6m3c7.fsf@guru.guru-group.fi>\r
+References: <cover.1385903109.git.jani@nikula.org>\r
+       <fc7ecd990e55fcfba17de4d71e8823c98760f9ce.1385903109.git.jani@nikula.org>\r
+       <87wqjm2m2q.fsf@zancas.localnet>\r
+       <m2iov6m3c7.fsf@guru.guru-group.fi>\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:29:25 +0200\r
+Message-ID: <871u1tyhai.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:29:42 -0000\r
+\r
+On Tue, 03 Dec 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Tue, Dec 03 2013, David Bremner <david@tethera.net> wrote:\r
+>\r
+>> The first patch looks ok. I like the new API overall.\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
+>> 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
+>>>  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
+>>\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
+> if that, then also database_path to options ?\r
+\r
+See my reply to David.\r
+\r
+> I also like this suggestion best of all seen so far, but what if:\r
+>\r
+>   #define NOTMUCH_MAJOR_VERSION      0\r
+>   #define NOTMUCH_MINOR_VERSION      17\r
+>  -#define NOTMUCH_MICRO_VERSION      0\r
+>  +#define NOTMUCH_MICRO_VERSION      90\r
+>\r
+> until changed API/ABI is set into stone (i.e. 0.18.0 at freeze time).\r
+\r
+That would require the user to conditional build with:\r
+\r
+#if NOTMUCH_CHECK_VERSION(0, 17, 90)\r
+       /* building against post-0.17 git master or released 0.18 */\r
+#else\r
+       /* building against 0.17 */\r
+#endif\r
+\r
+instead of the IMHO more natural and accurate:\r
+\r
+#if NOTMUCH_CHECK_VERSION(0, 18, 0)\r
+       /* building against post-0.17 git master or released 0.18 */\r
+#else\r
+       /* building against 0.17 */\r
+#endif\r
+\r
+\r
+BR,\r
+Jani.\r