--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1BF89431FBD\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:13:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 0shxEmHRDavl for <notmuch@notmuchmail.org>;\r
+ Sun, 23 Mar 2014 06:12:52 -0700 (PDT)\r
+Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com\r
+ [74.125.83.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 5243A431FB6 for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:12:52 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f49.google.com with SMTP id c41so3416931eek.22\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Mar 2014 06:12:50 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=O2mrJPjJ5xhGEzHGlPMY8BYDiV1K3S+dllokH3VQUl0=;\r
+ b=coQ5K4T7FL0pExwavtfvJpNrfQuPtBWnzv45HBwCFphIsc/MzL0u5uQVDRl2ImDh/j\r
+ 0z4D+QtPoreYDf48VlSDxuWKu9/1zF0iCeL+hDO+c8rNvWGTRnmKVXE0HrogcYg4/6QO\r
+ jatv5r/3ZDjtuq23x5t2a+MYK9uze0PyX/eUxVD3zTD/R9NeMoW2KnUhZX/rcpYTkovB\r
+ oYsarS+Wnz8+ZCR9qnXtnzTj8DLy+AeDl4/H56dqcr5tjCNSm26PiH2Hp67vOQ6o6+d9\r
+ +dqaNGZkpRfr22qnLRp29dzJKXrcs2a4Fvc3KFlEORtj014FYWrIxWc6kcB+tiHrgzeQ\r
+ Lm9Q==\r
+X-Gm-Message-State:\r
+ ALoCoQn0lhyV2VuAD7k3QoRcCWpq44B9NiR0tNFDSsKr8XDnWnGIir+2L9oIWKa2ltKf3sCJgf8H\r
+X-Received: by 10.15.51.141 with SMTP id n13mr18996241eew.17.1395580369653;\r
+ Sun, 23 Mar 2014 06:12:49 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91])\r
+ by mx.google.com with ESMTPSA id a42sm7841451ees.10.2014.03.23.06.12.48\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sun, 23 Mar 2014 06:12:48 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/2] config: add key database.upgrades\r
+In-Reply-To: <1395541573-2417-2-git-send-email-david@tethera.net>\r
+References: <87bnx4jyyp.fsf@servo.finestructure.net>\r
+ <1395541573-2417-1-git-send-email-david@tethera.net>\r
+ <1395541573-2417-2-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.17+149~g6de65e9791bc (http://notmuchmail.org)\r
+ Emacs/24.3.1 (x86_64-pc-linux-gnu)\r
+Date: Sun, 23 Mar 2014 15:12:47 +0200\r
+Message-ID: <87siq9rrcg.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 23 Mar 2014 13:13:00 -0000\r
+\r
+On Sun, 23 Mar 2014, David Bremner <david@tethera.net> wrote:\r
+> The intent is to allow the user to enable or disable automatic\r
+> database upgrades.\r
+>\r
+> This doesn't do anything yet.\r
+> ---\r
+> doc/man1/notmuch-config.rst | 4 ++++\r
+> notmuch-client.h | 7 +++++++\r
+> notmuch-config.c | 34 +++++++++++++++++++++++++++++-----\r
+> test/T030-config.sh | 1 +\r
+> test/T040-setup.sh | 1 +\r
+> 5 files changed, 42 insertions(+), 5 deletions(-)\r
+>\r
+> diff --git a/doc/man1/notmuch-config.rst b/doc/man1/notmuch-config.rst\r
+> index 3c9a568..fc7fab6 100644\r
+> --- a/doc/man1/notmuch-config.rst\r
+> +++ b/doc/man1/notmuch-config.rst\r
+> @@ -49,6 +49,10 @@ The available configuration items are described below.\r
+> within a sub-directory of the path configured here named\r
+> ``.notmuch``.\r
+> \r
+> + **database.upgrades**\r
+> + Set to ``yes`` to enable automatic in-place upgrades of the notmuch\r
+> + database.\r
+> +\r
+> **user.name**\r
+> Your full name.\r
+> \r
+> diff --git a/notmuch-client.h b/notmuch-client.h\r
+> index 278b498..3891a82 100644\r
+> --- a/notmuch-client.h\r
+> +++ b/notmuch-client.h\r
+> @@ -275,6 +275,13 @@ notmuch_config_set_database_path (notmuch_config_t *config,\r
+> const char *database_path);\r
+> \r
+> const char *\r
+> +notmuch_config_get_database_upgrades (notmuch_config_t *config);\r
+> +\r
+> +void\r
+> +notmuch_config_set_database_upgrades (notmuch_config_t *config,\r
+> + const char *database_upgrades);\r
+\r
+I'm opposed to adding a config option for this, but if you're going to\r
+do it anyway, please at least make it a bool. See synchronize flags\r
+option.\r
+\r
+BR,\r
+Jani.\r
+\r
+> +\r
+> +const char *\r
+> notmuch_config_get_user_name (notmuch_config_t *config);\r
+> \r
+> void\r
+> diff --git a/notmuch-config.c b/notmuch-config.c\r
+> index 8d28653..8f4ce99 100644\r
+> --- a/notmuch-config.c\r
+> +++ b/notmuch-config.c\r
+> @@ -32,11 +32,16 @@ static const char toplevel_config_comment[] =\r
+> static const char database_config_comment[] =\r
+> " Database configuration\n"\r
+> "\n"\r
+> - " The only value supported here is 'path' which should be the top-level\n"\r
+> - " directory where your mail currently exists and to where mail will be\n"\r
+> - " delivered in the future. Files should be individual email messages.\n"\r
+> - " Notmuch will store its database within a sub-directory of the path\n"\r
+> - " configured here named \".notmuch\".\n";\r
+> + "The following options are supported here:\n"\r
+> + "\n"\r
+> + "\tpath The top-level directory where your mail currently exists\n"\r
+> + "\t and to where mail will be delivered in the future. Files\n"\r
+> + "\t should be individual email messages. Notmuch will store\n"\r
+> + "\t its database within a sub-directory (named .notmuch) of\n"\r
+> + "\t the path configured here.\n"\r
+> + "\n"\r
+> + "\tupgrades Set to 'yes' to enable automatic database upgrades.\n"\r
+> + "\n";\r
+> \r
+> static const char new_config_comment[] =\r
+> " Configuration for \"notmuch new\"\n"\r
+> @@ -107,6 +112,7 @@ struct _notmuch_config {\r
+> notmuch_bool_t is_new;\r
+> \r
+> char *database_path;\r
+> + char *database_upgrades;\r
+> char *user_name;\r
+> char *user_primary_email;\r
+> const char **user_other_email;\r
+> @@ -265,6 +271,7 @@ notmuch_config_open (void *ctx,\r
+> \r
+> config->is_new = FALSE;\r
+> config->database_path = NULL;\r
+> + config->database_upgrades = NULL;\r
+> config->user_name = NULL;\r
+> config->user_primary_email = NULL;\r
+> config->user_other_email = NULL;\r
+> @@ -328,6 +335,10 @@ notmuch_config_open (void *ctx,\r
+> talloc_free (path);\r
+> }\r
+> \r
+> + if (notmuch_config_get_database_upgrades (config) == NULL) {\r
+> + notmuch_config_set_database_upgrades (config, "no");\r
+> + }\r
+> +\r
+> if (notmuch_config_get_user_name (config) == NULL) {\r
+> char *name = get_name_from_passwd_file (config);\r
+> notmuch_config_set_user_name (config, name);\r
+> @@ -582,6 +593,19 @@ notmuch_config_set_database_path (notmuch_config_t *config,\r
+> }\r
+> \r
+> const char *\r
+> +notmuch_config_get_database_upgrades (notmuch_config_t *config)\r
+> +{\r
+> + return _config_get (config, &config->database_upgrades, "database", "upgrades");\r
+> +}\r
+> +\r
+> +void\r
+> +notmuch_config_set_database_upgrades (notmuch_config_t *config,\r
+> + const char *database_upgrades)\r
+> +{\r
+> + _config_set (config, &config->database_upgrades, "database", "upgrades", database_upgrades);\r
+> +}\r
+> +\r
+> +const char *\r
+> notmuch_config_get_user_name (notmuch_config_t *config)\r
+> {\r
+> return _config_get (config, &config->user_name, "user", "name");\r
+> diff --git a/test/T030-config.sh b/test/T030-config.sh\r
+> index ca4cf33..d095f0e 100755\r
+> --- a/test/T030-config.sh\r
+> +++ b/test/T030-config.sh\r
+> @@ -47,6 +47,7 @@ notmuch config set database.path "/canonical/path"\r
+> output=$(notmuch config list)\r
+> test_expect_equal "$output" "\\r
+> database.path=/canonical/path\r
+> +database.upgrades=no\r
+> user.name=Notmuch Test Suite\r
+> user.primary_email=test_suite@notmuchmail.org\r
+> user.other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org\r
+> diff --git a/test/T040-setup.sh b/test/T040-setup.sh\r
+> index 124ef1c..46fd327 100755\r
+> --- a/test/T040-setup.sh\r
+> +++ b/test/T040-setup.sh\r
+> @@ -16,6 +16,7 @@ EOF\r
+> output=$(notmuch --config=new-notmuch-config config list)\r
+> test_expect_equal "$output" "\\r
+> database.path=/path/to/maildir\r
+> +database.upgrades=no\r
+> user.name=Test Suite\r
+> user.primary_email=test.suite@example.com\r
+> user.other_email=another.suite@example.com;\r
+> -- \r
+> 1.9.0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r