1 Return-Path: <jani@nikula.org>
\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 1BF89431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:13:00 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 0shxEmHRDavl for <notmuch@notmuchmail.org>;
\r
16 Sun, 23 Mar 2014 06:12:52 -0700 (PDT)
\r
17 Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com
\r
18 [74.125.83.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 5243A431FB6 for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:12:52 -0700
\r
22 Received: by mail-ee0-f49.google.com with SMTP id c41so3416931eek.22
\r
23 for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:12:50 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:subject:in-reply-to:references
\r
27 :user-agent:date:message-id:mime-version:content-type;
\r
28 bh=O2mrJPjJ5xhGEzHGlPMY8BYDiV1K3S+dllokH3VQUl0=;
\r
29 b=coQ5K4T7FL0pExwavtfvJpNrfQuPtBWnzv45HBwCFphIsc/MzL0u5uQVDRl2ImDh/j
\r
30 0z4D+QtPoreYDf48VlSDxuWKu9/1zF0iCeL+hDO+c8rNvWGTRnmKVXE0HrogcYg4/6QO
\r
31 jatv5r/3ZDjtuq23x5t2a+MYK9uze0PyX/eUxVD3zTD/R9NeMoW2KnUhZX/rcpYTkovB
\r
32 oYsarS+Wnz8+ZCR9qnXtnzTj8DLy+AeDl4/H56dqcr5tjCNSm26PiH2Hp67vOQ6o6+d9
\r
33 +dqaNGZkpRfr22qnLRp29dzJKXrcs2a4Fvc3KFlEORtj014FYWrIxWc6kcB+tiHrgzeQ
\r
36 ALoCoQn0lhyV2VuAD7k3QoRcCWpq44B9NiR0tNFDSsKr8XDnWnGIir+2L9oIWKa2ltKf3sCJgf8H
\r
37 X-Received: by 10.15.51.141 with SMTP id n13mr18996241eew.17.1395580369653;
\r
38 Sun, 23 Mar 2014 06:12:49 -0700 (PDT)
\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
41 by mx.google.com with ESMTPSA id a42sm7841451ees.10.2014.03.23.06.12.48
\r
42 for <multiple recipients>
\r
43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
44 Sun, 23 Mar 2014 06:12:48 -0700 (PDT)
\r
45 From: Jani Nikula <jani@nikula.org>
\r
46 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
47 Subject: Re: [PATCH 1/2] config: add key database.upgrades
\r
48 In-Reply-To: <1395541573-2417-2-git-send-email-david@tethera.net>
\r
49 References: <87bnx4jyyp.fsf@servo.finestructure.net>
\r
50 <1395541573-2417-1-git-send-email-david@tethera.net>
\r
51 <1395541573-2417-2-git-send-email-david@tethera.net>
\r
52 User-Agent: Notmuch/0.17+149~g6de65e9791bc (http://notmuchmail.org)
\r
53 Emacs/24.3.1 (x86_64-pc-linux-gnu)
\r
54 Date: Sun, 23 Mar 2014 15:12:47 +0200
\r
55 Message-ID: <87siq9rrcg.fsf@nikula.org>
\r
57 Content-Type: text/plain
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\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: Sun, 23 Mar 2014 13:13:00 -0000
\r
72 On Sun, 23 Mar 2014, David Bremner <david@tethera.net> wrote:
\r
73 > The intent is to allow the user to enable or disable automatic
\r
74 > database upgrades.
\r
76 > This doesn't do anything yet.
\r
78 > doc/man1/notmuch-config.rst | 4 ++++
\r
79 > notmuch-client.h | 7 +++++++
\r
80 > notmuch-config.c | 34 +++++++++++++++++++++++++++++-----
\r
81 > test/T030-config.sh | 1 +
\r
82 > test/T040-setup.sh | 1 +
\r
83 > 5 files changed, 42 insertions(+), 5 deletions(-)
\r
85 > diff --git a/doc/man1/notmuch-config.rst b/doc/man1/notmuch-config.rst
\r
86 > index 3c9a568..fc7fab6 100644
\r
87 > --- a/doc/man1/notmuch-config.rst
\r
88 > +++ b/doc/man1/notmuch-config.rst
\r
89 > @@ -49,6 +49,10 @@ The available configuration items are described below.
\r
90 > within a sub-directory of the path configured here named
\r
93 > + **database.upgrades**
\r
94 > + Set to ``yes`` to enable automatic in-place upgrades of the notmuch
\r
100 > diff --git a/notmuch-client.h b/notmuch-client.h
\r
101 > index 278b498..3891a82 100644
\r
102 > --- a/notmuch-client.h
\r
103 > +++ b/notmuch-client.h
\r
104 > @@ -275,6 +275,13 @@ notmuch_config_set_database_path (notmuch_config_t *config,
\r
105 > const char *database_path);
\r
108 > +notmuch_config_get_database_upgrades (notmuch_config_t *config);
\r
111 > +notmuch_config_set_database_upgrades (notmuch_config_t *config,
\r
112 > + const char *database_upgrades);
\r
114 I'm opposed to adding a config option for this, but if you're going to
\r
115 do it anyway, please at least make it a bool. See synchronize flags
\r
123 > notmuch_config_get_user_name (notmuch_config_t *config);
\r
126 > diff --git a/notmuch-config.c b/notmuch-config.c
\r
127 > index 8d28653..8f4ce99 100644
\r
128 > --- a/notmuch-config.c
\r
129 > +++ b/notmuch-config.c
\r
130 > @@ -32,11 +32,16 @@ static const char toplevel_config_comment[] =
\r
131 > static const char database_config_comment[] =
\r
132 > " Database configuration\n"
\r
134 > - " The only value supported here is 'path' which should be the top-level\n"
\r
135 > - " directory where your mail currently exists and to where mail will be\n"
\r
136 > - " delivered in the future. Files should be individual email messages.\n"
\r
137 > - " Notmuch will store its database within a sub-directory of the path\n"
\r
138 > - " configured here named \".notmuch\".\n";
\r
139 > + "The following options are supported here:\n"
\r
141 > + "\tpath The top-level directory where your mail currently exists\n"
\r
142 > + "\t and to where mail will be delivered in the future. Files\n"
\r
143 > + "\t should be individual email messages. Notmuch will store\n"
\r
144 > + "\t its database within a sub-directory (named .notmuch) of\n"
\r
145 > + "\t the path configured here.\n"
\r
147 > + "\tupgrades Set to 'yes' to enable automatic database upgrades.\n"
\r
150 > static const char new_config_comment[] =
\r
151 > " Configuration for \"notmuch new\"\n"
\r
152 > @@ -107,6 +112,7 @@ struct _notmuch_config {
\r
153 > notmuch_bool_t is_new;
\r
155 > char *database_path;
\r
156 > + char *database_upgrades;
\r
158 > char *user_primary_email;
\r
159 > const char **user_other_email;
\r
160 > @@ -265,6 +271,7 @@ notmuch_config_open (void *ctx,
\r
162 > config->is_new = FALSE;
\r
163 > config->database_path = NULL;
\r
164 > + config->database_upgrades = NULL;
\r
165 > config->user_name = NULL;
\r
166 > config->user_primary_email = NULL;
\r
167 > config->user_other_email = NULL;
\r
168 > @@ -328,6 +335,10 @@ notmuch_config_open (void *ctx,
\r
169 > talloc_free (path);
\r
172 > + if (notmuch_config_get_database_upgrades (config) == NULL) {
\r
173 > + notmuch_config_set_database_upgrades (config, "no");
\r
176 > if (notmuch_config_get_user_name (config) == NULL) {
\r
177 > char *name = get_name_from_passwd_file (config);
\r
178 > notmuch_config_set_user_name (config, name);
\r
179 > @@ -582,6 +593,19 @@ notmuch_config_set_database_path (notmuch_config_t *config,
\r
183 > +notmuch_config_get_database_upgrades (notmuch_config_t *config)
\r
185 > + return _config_get (config, &config->database_upgrades, "database", "upgrades");
\r
189 > +notmuch_config_set_database_upgrades (notmuch_config_t *config,
\r
190 > + const char *database_upgrades)
\r
192 > + _config_set (config, &config->database_upgrades, "database", "upgrades", database_upgrades);
\r
196 > notmuch_config_get_user_name (notmuch_config_t *config)
\r
198 > return _config_get (config, &config->user_name, "user", "name");
\r
199 > diff --git a/test/T030-config.sh b/test/T030-config.sh
\r
200 > index ca4cf33..d095f0e 100755
\r
201 > --- a/test/T030-config.sh
\r
202 > +++ b/test/T030-config.sh
\r
203 > @@ -47,6 +47,7 @@ notmuch config set database.path "/canonical/path"
\r
204 > output=$(notmuch config list)
\r
205 > test_expect_equal "$output" "\
\r
206 > database.path=/canonical/path
\r
207 > +database.upgrades=no
\r
208 > user.name=Notmuch Test Suite
\r
209 > user.primary_email=test_suite@notmuchmail.org
\r
210 > user.other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org
\r
211 > diff --git a/test/T040-setup.sh b/test/T040-setup.sh
\r
212 > index 124ef1c..46fd327 100755
\r
213 > --- a/test/T040-setup.sh
\r
214 > +++ b/test/T040-setup.sh
\r
215 > @@ -16,6 +16,7 @@ EOF
\r
216 > output=$(notmuch --config=new-notmuch-config config list)
\r
217 > test_expect_equal "$output" "\
\r
218 > database.path=/path/to/maildir
\r
219 > +database.upgrades=no
\r
220 > user.name=Test Suite
\r
221 > user.primary_email=test.suite@example.com
\r
222 > user.other_email=another.suite@example.com;
\r
226 > _______________________________________________
\r
227 > notmuch mailing list
\r
228 > notmuch@notmuchmail.org
\r
229 > http://notmuchmail.org/mailman/listinfo/notmuch
\r