From dc3987c95b30830bbeee65ba8cce6b4b18c38ef8 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 8 Oct 2013 07:48:16 +0100 Subject: [PATCH] Re: [PATCH 02/11] cli: Separate current and deprecated format version --- 22/53d4a87aa652995ee49c52b1ee79f3ac92a31a | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 22/53d4a87aa652995ee49c52b1ee79f3ac92a31a diff --git a/22/53d4a87aa652995ee49c52b1ee79f3ac92a31a b/22/53d4a87aa652995ee49c52b1ee79f3ac92a31a new file mode 100644 index 000000000..291a9e1a9 --- /dev/null +++ b/22/53d4a87aa652995ee49c52b1ee79f3ac92a31a @@ -0,0 +1,126 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 39899431FAF + for ; Mon, 7 Oct 2013 23:48:27 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id vq+E7rRkOnaw for ; + Mon, 7 Oct 2013 23:48:23 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E07A8431FAE + for ; Mon, 7 Oct 2013 23:48:22 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1VTR5d-00071M-Mk; Tue, 08 Oct 2013 07:48:20 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1VTR5d-0004wh-DH; Tue, 08 Oct 2013 07:48:17 +0100 +From: Mark Walters +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH 02/11] cli: Separate current and deprecated format version +In-Reply-To: <1381185201-25197-3-git-send-email-amdragon@mit.edu> +References: <1381185201-25197-1-git-send-email-amdragon@mit.edu> + <1381185201-25197-3-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.16 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 08 Oct 2013 07:48:16 +0100 +Message-ID: <87li24qmvj.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: c2eda50662eedae62c3917f54ed92ea8 (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Tue, 08 Oct 2013 06:48:27 -0000 + +On Mon, 07 Oct 2013, Austin Clements wrote: +> Previously, the CLI would print a deprecation warning if a client +> requested any format version other than the current one. However, if +> we add fields that are backwards-compatible, but want clients to be +> able to depend on, we need to bump the version, but that doesn't make +> the older version deprecated. +> +> Hence, separate out the "minimum active" version and only print a +> warning for requests below this version number. +> --- +> notmuch-client.h | 5 +++++ +> notmuch.c | 2 +- +> 2 files changed, 6 insertions(+), 1 deletion(-) +> +> diff --git a/notmuch-client.h b/notmuch-client.h +> index afb0ddf..8d986f4 100644 +> --- a/notmuch-client.h +> +++ b/notmuch-client.h +> @@ -142,6 +142,11 @@ chomp_newline (char *str) +> /* The minimum supported structured output format version. Requests +> * for format versions below this will return an error. */ +> #define NOTMUCH_FORMAT_MIN 1 +> +/* The minimum non-deprecated structured output format version. +> + * Requests for format versions below this will print a stern warning. +> + * Must be >= NOTMUCH_FORMAT_MIN and < NOTMUCH_FORMAT_CUR. +> + */ + +Should this be <= NOTMUCH_FORMAT_CUR ? + +Best wishes + +Mark + +> +#define NOTMUCH_FORMAT_MIN_ACTIVE 1 +> +> /* The output format version requested by the caller on the command +> * line. If no format version is requested, this will be set to +> diff --git a/notmuch.c b/notmuch.c +> index 7300c21..6588003 100644 +> --- a/notmuch.c +> +++ b/notmuch.c +> @@ -125,7 +125,7 @@ by the notmuch CLI (it requires at least version %d). You may need to\n\ +> upgrade your notmuch front-end.\n", +> notmuch_format_version, NOTMUCH_FORMAT_MIN); +> exit (NOTMUCH_EXIT_FORMAT_TOO_OLD); +> - } else if (notmuch_format_version != NOTMUCH_FORMAT_CUR) { +> + } else if (notmuch_format_version < NOTMUCH_FORMAT_MIN_ACTIVE) { +> /* Warn about old version requests so compatibility issues are +> * less likely when we drop support for a deprecated format +> * versions. */ +> -- +> 1.8.4.rc3 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2