From: Daniel Kahn Gillmor Date: Wed, 1 Jun 2016 01:52:06 +0000 (+2000) Subject: Re: [RFC2 Patch 5/5] lib: iterator API for message properties X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b7f91c987791a1f20c8c10cf7946024986afa755;p=notmuch-archives.git Re: [RFC2 Patch 5/5] lib: iterator API for message properties --- diff --git a/0c/350d59a11998de600d126c906c886b127bd9e3 b/0c/350d59a11998de600d126c906c886b127bd9e3 new file mode 100644 index 000000000..638d5c2ea --- /dev/null +++ b/0c/350d59a11998de600d126c906c886b127bd9e3 @@ -0,0 +1,120 @@ +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 B76606DE02A9 + for ; Tue, 31 May 2016 18:58:33 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.024 +X-Spam-Level: +X-Spam-Status: No, score=-0.024 tagged_above=-999 required=5 + tests=[AWL=-0.024] 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 vz06-e1gT_zD for ; + Tue, 31 May 2016 18:58:25 -0700 (PDT) +X-Greylist: delayed 375 seconds by postgrey-1.35 at arlo; + Tue, 31 May 2016 18:58:24 PDT +Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) + by arlo.cworth.org (Postfix) with ESMTP id EE5E96DE02A6 + for ; Tue, 31 May 2016 18:58:24 -0700 (PDT) +Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net + [108.58.6.98]) + by che.mayfirst.org (Postfix) with ESMTPSA id 89664F98B; + Tue, 31 May 2016 21:52:06 -0400 (EDT) +Received: by fifthhorseman.net (Postfix, from userid 1000) + id 60159201E6; Tue, 31 May 2016 21:52:06 -0400 (EDT) +From: Daniel Kahn Gillmor +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+16~g87b7bd4 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Tue, 31 May 2016 21:52:06 -0400 +Message-ID: <87pos1u14p.fsf@alice.fifthhorseman.net> +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 01:58:33 -0000 + +On Tue 2016-05-31 21:12:21 -0400, David Bremner wrote: +> 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. + +The other concern is our conception of how properties are unset/removed, +right? + +With tags, it's possible to include -blah to remove the tag "blah". how +do we remove/clear/overwrite these tags? what about using +key=val or +-key=val to set/unset certain key/value combinations, and a value-less +key= to remove all values matching a given key? + +alternately: + + key=val (clears all values for "key", and sets a new value "val") + key+=val (appends a value "val" for "key") + key-=val (removes any "key" set to "val") + key= (clears all values for "key" + +--------- + +However we resolve this particular decision, it'd be nice to have a +stable, sane story about backward compatibility going forward, so that +we don't have to worry about it in the future. + +For example, each dump file could start with a line like: + + #version 1 + +and notmuch restore would assume that without "#version n" as the first +line, it's version 0. then notmuch restore could decline to parse dump +files of a version that it doesn't know about. + +Alternately, we could have the first line be something like: + + #features config properties + +and if the first line is not #features, then we assume that no features +are in place -- but if restore sees features it doesn't know about, it +can offer to proceed while warning the user that we might miss something +(or that something might break). + + +Thanks for working on this, David! I think this is going to be really +useful! + + --dkg