Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / d3 / 0b5d7e5d826e1997343f77e869c2cd19f54cd3
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 606276DE02AD\r
6  for <notmuch@notmuchmail.org>; Tue, 31 May 2016 21:38:46 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.579\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.579 tagged_above=-999 required=5 tests=[AWL=-0.073,\r
12   SPF_NEUTRAL=0.652] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id CbC9LpVYeSwq for <notmuch@notmuchmail.org>;\r
16  Tue, 31 May 2016 21:38:38 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id 188956DE02A9\r
19  for <notmuch@notmuchmail.org>; Tue, 31 May 2016 21:38:37 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id 1B9D410008E;\r
22  Wed,  1 Jun 2016 07:38:18 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [RFC2 Patch 5/5] lib: iterator API for message properties\r
26 In-Reply-To: <8760tthfuy.fsf@zancas.localnet>\r
27 References: <1463927339-5441-1-git-send-email-david@tethera.net>\r
28  <1464608999-14774-1-git-send-email-david@tethera.net>\r
29  <1464608999-14774-6-git-send-email-david@tethera.net>\r
30  <8760tthfuy.fsf@zancas.localnet>\r
31 User-Agent: Notmuch/0.22+32~gd4854c5 (http://notmuchmail.org) Emacs/24.5.1\r
32  (x86_64-unknown-linux-gnu)\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
34  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
35  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
36 Date: Wed, 01 Jun 2016 07:38:17 +0300\r
37 Message-ID: <m2r3chcyme.fsf@guru.guru-group.fi>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.20\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44  <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
46  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
51  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Wed, 01 Jun 2016 04:38:46 -0000\r
53 \r
54 On Wed, Jun 01 2016, David Bremner <david@tethera.net> wrote:\r
55 \r
56 > David Bremner <david@tethera.net> writes:\r
57 >\r
58 >> +   notmuch_message_properties_t *list;\r
59 >> +   RUN(notmuch_message_add_property (message, "testkey1", "bob"));\r
60 >> +   RUN(notmuch_message_add_property (message, "testkey1", "testvalue2"));\r
61 >> +   RUN(notmuch_message_add_property (message, "testkey1", "alice"));\r
62 >> +\r
63 >> +   for (list = notmuch_message_get_properties (message, "testkey1", TRUE);\r
64 >> +        notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) {\r
65 >> +      printf("%s\n", notmuch_message_properties_value(list));\r
66 >> +   }\r
67 >> +   notmuch_message_properties_destroy (list);\r
68 >\r
69 > I was thinking a bit about how to dump/restore these.\r
70 >\r
71 > The most upwardly compatible way that i thought of is something like\r
72 >\r
73 > #= msg-id key=val key=val\r
74 >\r
75 > i.e. duplicate the msg-id for messages with properties\r
76 >\r
77 > This would be ignored by old notmuch-restore.\r
78 >\r
79 > Otherwise, maybe something like\r
80 >\r
81 > msg-id -- +tag +tag # key=val key=val\r
82 >\r
83 > I'm not sure. this might crash old notmuch-restore.\r
84 >\r
85 > How important is backward compatibility, and how important is minimizing\r
86 > dump size? It's a bit hard to predict the things people might use\r
87 > message properties for, but for thread surgery, I would expect a small\r
88 > number of messages with properties.\r
89 \r
90 If we had compatibility version information in the dump file we could just\r
91 bump the version. (and if we added to newer, old notmuches would not\r
92 magically get that feature ;/)\r
93 \r
94 Anyay, IMO we could make backward-incompatible changes, and then perhaps\r
95 provide conversion program (a few lines of perl(1) anyway (more lines on\r
96 many other))\r
97 \r
98 Tomi\r
99 \r
100 >\r
101 > d\r