[PATCH 2/9] lib: private string map (associative array) API
[notmuch-archives.git] / 1f / 6c8228358b0a4c89f9c25153f7ae3d8a2b16d9
1 Return-Path: <anthony.j.towns@gmail.com>\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 olra.theworths.org (Postfix) with ESMTP id 84FA9431FC1\r
6         for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 20:13:41 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.499\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.499 tagged_above=-999 required=5\r
12         tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=unavailable\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id krTLxq60iver for <notmuch@notmuchmail.org>;\r
17         Wed, 21 Apr 2010 20:13:40 -0700 (PDT)\r
18 Received: from mail-gx0-f212.google.com (mail-gx0-f212.google.com\r
19         [209.85.217.212])\r
20         by olra.theworths.org (Postfix) with ESMTP id E72A94196F2\r
21         for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 20:13:39 -0700 (PDT)\r
22 Received: by gxk4 with SMTP id 4so23619gxk.2\r
23         for <notmuch@notmuchmail.org>; Wed, 21 Apr 2010 20:13:39 -0700 (PDT)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
25         h=domainkey-signature:mime-version:sender:received:in-reply-to\r
26         :references:date:x-google-sender-auth:received:message-id:subject\r
27         :from:to:cc:content-type:content-transfer-encoding;\r
28         bh=ZIeXl+Q6qrXj99TrDA0+iPUucbRc4enbQYjvfkc2/So=;\r
29         b=QYS4vti5+NZ+Gj5aDlco0kW+NruyvZlFnq3zjrLcnM4SKCi9pfRYM9QgznnxicDexX\r
30         FoXidnoAXwKd7TmDieh3jkdLJoXxAyyi7rBT/XnZrxWISV1GYq3EJAmkAdiG2IJeRWed\r
31         KILiG0dyYJrndhKAq/I6fd1QcPpAEONNjioyo=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=mime-version:sender:in-reply-to:references:date\r
34         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
35         :content-transfer-encoding;\r
36         b=W+KedokSecZ8xUU08hBrRls8KZgoR8NtUaV+xpszkhNmqZhZuqq/E+mAw+8a9B8cTX\r
37         i1rf4Vd6jo9tBkO516XLqMDM79jLove8gEx460GsvLuCfuskgU5G3SL3Qpk9reVpVva2\r
38         jdl+X0y83809WEFsgqWDiXpfKnHWTRVst6V4c=\r
39 MIME-Version: 1.0\r
40 Sender: anthony.j.towns@gmail.com\r
41 Received: by 10.90.114.1 with HTTP; Wed, 21 Apr 2010 20:13:39 -0700 (PDT)\r
42 In-Reply-To: <m3d3xsyzyn.fsf@x200.gr8dns.org>\r
43 References: <1271747793-17507-1-git-send-email-sojkam1@fel.cvut.cz>\r
44         <87pr1u7fnu.fsf@ut.hh.sledj.net> <87fx2qmtok.fsf@SSpaeth.de>\r
45         <4BCD7EA0.3080505@fel.cvut.cz> <871ve8wc30.fsf@yoom.home.cworth.org>\r
46         <m3d3xsyzyn.fsf@x200.gr8dns.org>\r
47 Date: Thu, 22 Apr 2010 13:13:39 +1000\r
48 X-Google-Sender-Auth: b05012bcee674a8d\r
49 Received: by 10.90.40.18 with SMTP id n18mr4823609agn.28.1271906019297; Wed, \r
50         21 Apr 2010 20:13:39 -0700 (PDT)\r
51 Message-ID: <w2w87b3a4191004212013r8d410ca6u5c0651d3ee74aa7@mail.gmail.com>\r
52 Subject: Re: [PATCH 1/2] Add 'cat' subcommand\r
53 From: Anthony Towns <aj@erisian.com.au>\r
54 To: Dirk Hohndel <hohndel@infradead.org>\r
55 Content-Type: text/plain; charset=ISO-8859-1\r
56 Content-Transfer-Encoding: quoted-printable\r
57 Cc: notmuch@notmuchmail.org\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Thu, 22 Apr 2010 03:13:41 -0000\r
71 \r
72 On Thu, Apr 22, 2010 at 12:37, Dirk Hohndel <hohndel@infradead.org> wrote:\r
73 > On Wed, 21 Apr 2010 17:44:03 -0700, Carl Worth <cworth@cworth.org> wrote:\r
74 >> So I'd prefer to have this command behave just like all others and use\r
75 >> the same naming.\r
76 >> =A0 =A0 =A0 filename:/complete/path/to/file\r
77 \r
78 Would "notmuch cat" be any different to "notmuch show" in this case?\r
79 What happens if you say "notmuch cat something" and multiple messages\r
80 match (eg, an id: for a mail that you both sent (Mail/.sent/cur/12345)\r
81 and received (Mail/.Lists.notmuch/cur/12346))?\r
82 \r
83 Maybe notmuch show should be able to deal with all these things, and\r
84 notmuch cat could be an alias for something like:\r
85 \r
86     notmuch show --format=3Dmbox --show-duplicate-files $SPEC\r
87 \r
88 ?\r
89 \r
90 > should we extend this to something generic that allows remote\r
91 > specifications?\r
92 > URI:file/path/to/local/file\r
93 > URI:ssh/user@host/path/to/file\r
94 > URI:git/user@host/path/to/file\r
95 \r
96 You could already do that by using FUSE filesystems to mount your\r
97 remote mail dirs under those paths, without having to teach notmuch\r
98 about those protocols, as long as you still have the Xapian database\r
99 local.\r
100 \r
101 If the Xapian database is remote, you need to invoke "ssh $USER@$HOST\r
102 notmuch" (or similar) instead of "notmuch", but the "cat" patch should\r
103 be enough to make that work right.\r
104 \r
105 Otherwise, wouldn't you be better off just having this be something\r
106 for the database::path setting in .notmuch-config? So you say:\r
107 \r
108    [database]\r
109    path=3D/home/aj/Mail\r
110 \r
111 or\r
112 \r
113    [database]\r
114    path=3D/home/aj/Mail/.git\r
115    format=3Dgit\r
116 \r
117 or\r
118 \r
119    [database]\r
120    # multiple backends\r
121    path=3D/home/aj/Mail\r
122    path=3Dgit:///home/aj/OldMail.git\r
123 \r
124 and have filename: just serve as a unique id that the database knows\r
125 how to convert to the contents of the file?\r
126 \r
127 At most (afaics) maybe you'd want to say something like:\r
128 \r
129     [database]\r
130     path=3D/home/aj/Mail\r
131     path.old=3Dgit:///home/aj/OldMail.git\r
132 \r
133 so that any filename starting with "old/" has the "old/" trimmed and\r
134 gets passed to the git backend, while the rest go to the default file\r
135 backend.\r
136 \r
137 Cheers,\r
138 aj\r
139 \r
140 --=20\r
141 Anthony Towns <aj@erisian.com.au>\r