From: Austin Clements Date: Mon, 7 Oct 2013 22:33:12 +0000 (+2000) Subject: [PATCH 02/11] cli: Separate current and deprecated format version X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c19a5af690905bee0fd07de962eefcc822042737;p=notmuch-archives.git [PATCH 02/11] cli: Separate current and deprecated format version --- diff --git a/70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617 b/70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617 new file mode 100644 index 000000000..3065f5b00 --- /dev/null +++ b/70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617 @@ -0,0 +1,116 @@ +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 036A6431FD4 + for ; Mon, 7 Oct 2013 15:34:08 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 oOcPyqvf1YcN for ; + Mon, 7 Oct 2013 15:34:03 -0700 (PDT) +Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu + [18.7.68.35]) + by olra.theworths.org (Postfix) with ESMTP id 2BB71431FD5 + for ; Mon, 7 Oct 2013 15:33:37 -0700 (PDT) +X-AuditID: 12074423-b7fc98e0000009a2-0d-525336c05c6c +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP + id A5.7B.02466.0C633525; Mon, 7 Oct 2013 18:33:36 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r97MXPJm024576; + Mon, 7 Oct 2013 18:33:26 -0400 +Received: from drake.dyndns.org (26-4-172.dynamic.csail.mit.edu [18.26.4.172]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r97MXNRq028499 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 7 Oct 2013 18:33:25 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VTJMh-0006bj-Jf; Mon, 07 Oct 2013 18:33:23 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 02/11] cli: Separate current and deprecated format version +Date: Mon, 7 Oct 2013 18:33:12 -0400 +Message-Id: <1381185201-25197-3-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.8.4.rc3 +In-Reply-To: <1381185201-25197-1-git-send-email-amdragon@mit.edu> +References: <1381185201-25197-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixCmqrXvALDjI4O8Wa4vrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY9aza+wFD/gqFlxpZm5g/MXdxcjJISFgIvFr4Xk2CFtM4sK9 + 9UA2F4eQwD5GiR/TG5khnA2MEg+eHIRyDjNJXFuwAsqZyyixufcRC0g/m4CGxLb9yxlBbBEB + aYmdd2ezdjFycDALqEn86VIBCQsLeEk8/jwfrJxFQFWiu68bbDWvgIPEpX3rWCDOUJJYeGob + K4jNKeAosWTjRbAaIaCaufsXsU5g5F/AyLCKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI10wvN7NE + LzWldBMjKGzYXZR3MP45qHSIUYCDUYmHN+NoUJAQa2JZcWXuIUZJDiYlUd4HxsFBQnxJ+SmV + GYnFGfFFpTmpxYcYJTiYlUR4BYyAcrwpiZVVqUX5MClpDhYlcd5bHPZBQgLpiSWp2ampBalF + MFkZDg4lCd4wU6BGwaLU9NSKtMycEoQ0EwcnyHAeoOHJIDW8xQWJucWZ6RD5U4yKUuK8s0ES + AiCJjNI8uF5YXL9iFAd6RZh3K0gVDzAlwHW/AhrMBDRYlz0QZHBJIkJKqoFRN2Lr1KmMX3av + mmq3TfThsscSwChcJx4ftHCO/OLNqRw3lf/OT1FYMK1olsy5s4eEzLd6TfMtbbyWVHWZbc4m + 85LaVqbVsfHhiVkPfI9/bNWYUmtuOy/004P7cXNEuzhKT5xdsvytV8jSfK3QigOxszTnNC99 + Uit/Oba43EDt9bspKReDyg8rsRRnJBpqMRcVJwIAEmJTBcYCAAA= +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: Mon, 07 Oct 2013 22:34:08 -0000 + +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. ++ */ ++#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 +