From d0a9f48639b8db3ac5f287ce69d8fc23f1ea595a Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 25 Oct 2013 11:19:02 +2000 Subject: [PATCH] [PATCH v2 02/11] cli: Separate current and deprecated format version --- b5/59027b4a3ef9ae3194fb61fc317affab0bf4e6 | 118 ++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 b5/59027b4a3ef9ae3194fb61fc317affab0bf4e6 diff --git a/b5/59027b4a3ef9ae3194fb61fc317affab0bf4e6 b/b5/59027b4a3ef9ae3194fb61fc317affab0bf4e6 new file mode 100644 index 000000000..aac6fc50e --- /dev/null +++ b/b5/59027b4a3ef9ae3194fb61fc317affab0bf4e6 @@ -0,0 +1,118 @@ +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 277B1429E49 + for ; Thu, 24 Oct 2013 08:19:23 -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 33WI5egioZOz for ; + Thu, 24 Oct 2013 08:19:17 -0700 (PDT) +Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu + [18.9.25.15]) + by olra.theworths.org (Postfix) with ESMTP id D0AA1429E39 + for ; Thu, 24 Oct 2013 08:19:16 -0700 (PDT) +X-AuditID: 1209190f-b7fa08e0000009c6-9e-52693a7420bc +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP + id 46.10.02502.47A39625; Thu, 24 Oct 2013 11:19:16 -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 r9OFJF3C030434; + Thu, 24 Oct 2013 11:19:15 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9OFJCre012907 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 24 Oct 2013 11:19:14 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VZMgq-0006dl-Mn; Thu, 24 Oct 2013 11:19:12 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 02/11] cli: Separate current and deprecated format version +Date: Thu, 24 Oct 2013 11:19:02 -0400 +Message-Id: <1382627951-25252-3-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.8.4.rc3 +In-Reply-To: <1382627951-25252-1-git-send-email-amdragon@mit.edu> +References: <1382627951-25252-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixCmqrVtilRlkcPW8hEXTdGeL1XN5LK7f + nMnswOyxc9Zddo9b91+zezxbdYs5gDmKyyYlNSezLLVI3y6BK6Nl0Rnmgi98FY2PjjI2MHbz + dDFyckgImEjsenCSDcIWk7hwbz2QzcUhJLCPUeLunGlQzkZGiR+Tn7JDOHeYJObv/cEI4cxl + lJjS+RGsn01AQ2Lb/uWMILaIgLTEzruzWUFsZoFoiSOXZ4DVCAv4Sqz/9BashkVAVeLK3kns + IDavgIPEpnm7WSDuUJJYeGobWC+ngKPEz9fXwOqFgGp+/T7DMoGRfwEjwypG2ZTcKt3cxMyc + 4tRk3eLkxLy81CJdE73czBK91JTSTYzg4JLk38H47aDSIUYBDkYlHl6ND+lBQqyJZcWVuYcY + JTmYlER575lmBgnxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4Z2mB5TjTUmsrEotyodJSXOwKInz + 3uSwDxISSE8sSc1OTS1ILYLJynBwKEnwdloCNQoWpaanVqRl5pQgpJk4OEGG8wANXwpSw1tc + kJhbnJkOkT/FqCglzjsPJCEAksgozYPrhUX/K0ZxoFeEeTeBVPEAEwdc9yugwUxAg6csSQMZ + XJKIkJJqYBTqC7UQWLqB+4gk2+JN4at5pqxMi89axHyPRUzcwSZ3VWMbq+bZtTvmHd52XGi9 + SHY286sznwpuFDRdtJ161nv/Vna5ftGXh++Gp6c2Ts28zlpk/uXHvJVfe7Rz9x+qPKR2eMpZ + 97qElTO8Yuw6t+R9sTFKW3/XctLztfNnad79krv45PkLjluUWIozEg21mIuKEwErz1Ld2QIA AA== +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: Thu, 24 Oct 2013 15:19:23 -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 | 6 ++++++ + notmuch.c | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/notmuch-client.h b/notmuch-client.h +index 0bfa4da..4ecb3ae 100644 +--- a/notmuch-client.h ++++ b/notmuch-client.h +@@ -142,6 +142,12 @@ 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 between NOTMUCH_FORMAT_MIN and NOTMUCH_FORMAT_CUR, ++ * inclusive. ++ */ ++#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 8d303a1..54f46c6 100644 +--- a/notmuch.c ++++ b/notmuch.c +@@ -127,7 +127,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 + -- 2.26.2