From: Tomi Ollila Date: Wed, 1 Jun 2016 04:38:17 +0000 (+0300) Subject: Re: [RFC2 Patch 5/5] lib: iterator API for message properties X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e274e5fba345246a520f71643d842f33b4fcd391;p=notmuch-archives.git Re: [RFC2 Patch 5/5] lib: iterator API for message properties --- diff --git a/d3/0b5d7e5d826e1997343f77e869c2cd19f54cd3 b/d3/0b5d7e5d826e1997343f77e869c2cd19f54cd3 new file mode 100644 index 000000000..b2c3da67c --- /dev/null +++ b/d3/0b5d7e5d826e1997343f77e869c2cd19f54cd3 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 606276DE02AD + for ; Tue, 31 May 2016 21:38:46 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.579 +X-Spam-Level: +X-Spam-Status: No, score=0.579 tagged_above=-999 required=5 tests=[AWL=-0.073, + SPF_NEUTRAL=0.652] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id CbC9LpVYeSwq for ; + Tue, 31 May 2016 21:38:38 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id 188956DE02A9 + for ; Tue, 31 May 2016 21:38:37 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 1B9D410008E; + Wed, 1 Jun 2016 07:38:18 +0300 (EEST) +From: Tomi Ollila +To: David Bremner , notmuch@notmuchmail.org +Subject: Re: [RFC2 Patch 5/5] lib: iterator API for message properties +In-Reply-To: <8760tthfuy.fsf@zancas.localnet> +References: <1463927339-5441-1-git-send-email-david@tethera.net> + <1464608999-14774-1-git-send-email-david@tethera.net> + <1464608999-14774-6-git-send-email-david@tethera.net> + <8760tthfuy.fsf@zancas.localnet> +User-Agent: Notmuch/0.22+32~gd4854c5 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Wed, 01 Jun 2016 04:38:46 -0000 + +On Wed, Jun 01 2016, David Bremner wrote: + +> David Bremner writes: +> +>> + notmuch_message_properties_t *list; +>> + RUN(notmuch_message_add_property (message, "testkey1", "bob")); +>> + RUN(notmuch_message_add_property (message, "testkey1", "testvalue2")); +>> + RUN(notmuch_message_add_property (message, "testkey1", "alice")); +>> + +>> + for (list = notmuch_message_get_properties (message, "testkey1", TRUE); +>> + notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) { +>> + printf("%s\n", notmuch_message_properties_value(list)); +>> + } +>> + notmuch_message_properties_destroy (list); +> +> I was thinking a bit about how to dump/restore these. +> +> The most upwardly compatible way that i thought of is something like +> +> #= msg-id key=val key=val +> +> i.e. duplicate the msg-id for messages with properties +> +> This would be ignored by old notmuch-restore. +> +> Otherwise, maybe something like +> +> msg-id -- +tag +tag # key=val key=val +> +> I'm not sure. this might crash old notmuch-restore. +> +> How important is backward compatibility, and how important is minimizing +> dump size? It's a bit hard to predict the things people might use +> message properties for, but for thread surgery, I would expect a small +> number of messages with properties. + +If we had compatibility version information in the dump file we could just +bump the version. (and if we added to newer, old notmuches would not +magically get that feature ;/) + +Anyay, IMO we could make backward-incompatible changes, and then perhaps +provide conversion program (a few lines of perl(1) anyway (more lines on +many other)) + +Tomi + +> +> d