[PATCH 02/11] cli: Separate current and deprecated format version
authorAustin Clements <amdragon@MIT.EDU>
Mon, 7 Oct 2013 22:33:12 +0000 (18:33 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:17 +0000 (09:57 -0800)
70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617 [new file with mode: 0644]

diff --git a/70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617 b/70/eec171b4c00c8fd001ffdfd1214d9f4b3fb617
new file mode 100644 (file)
index 0000000..3065f5b
--- /dev/null
@@ -0,0 +1,116 @@
+Return-Path: <amdragon@mit.edu>\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 036A6431FD4\r
+       for <notmuch@notmuchmail.org>; Mon,  7 Oct 2013 15:34:08 -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 oOcPyqvf1YcN for <notmuch@notmuchmail.org>;\r
+       Mon,  7 Oct 2013 15:34:03 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu\r
+       [18.7.68.35])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2BB71431FD5\r
+       for <notmuch@notmuchmail.org>; Mon,  7 Oct 2013 15:33:37 -0700 (PDT)\r
+X-AuditID: 12074423-b7fc98e0000009a2-0d-525336c05c6c\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A5.7B.02466.0C633525; Mon,  7 Oct 2013 18:33:36 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r97MXPJm024576; \r
+       Mon, 7 Oct 2013 18:33:26 -0400\r
+Received: from drake.dyndns.org (26-4-172.dynamic.csail.mit.edu [18.26.4.172])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r97MXNRq028499\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Mon, 7 Oct 2013 18:33:25 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1VTJMh-0006bj-Jf; Mon, 07 Oct 2013 18:33:23 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 02/11] cli: Separate current and deprecated format version\r
+Date: Mon,  7 Oct 2013 18:33:12 -0400\r
+Message-Id: <1381185201-25197-3-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <1381185201-25197-1-git-send-email-amdragon@mit.edu>\r
+References: <1381185201-25197-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixCmqrXvALDjI4O8Wa4vrN2cyOzB6PFt1\r
+       izmAMYrLJiU1J7MstUjfLoErY9aza+wFD/gqFlxpZm5g/MXdxcjJISFgIvFr4Xk2CFtM4sK9\r
+       9UA2F4eQwD5GiR/TG5khnA2MEg+eHIRyDjNJXFuwAsqZyyixufcRC0g/m4CGxLb9yxlBbBEB\r
+       aYmdd2ezdjFycDALqEn86VIBCQsLeEk8/jwfrJxFQFWiu68bbDWvgIPEpX3rWCDOUJJYeGob\r
+       K4jNKeAosWTjRbAaIaCaufsXsU5g5F/AyLCKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI10wvN7NE\r
+       LzWldBMjKGzYXZR3MP45qHSIUYCDUYmHN+NoUJAQa2JZcWXuIUZJDiYlUd4HxsFBQnxJ+SmV\r
+       GYnFGfFFpTmpxYcYJTiYlUR4BYyAcrwpiZVVqUX5MClpDhYlcd5bHPZBQgLpiSWp2ampBalF\r
+       MFkZDg4lCd4wU6BGwaLU9NSKtMycEoQ0EwcnyHAeoOHJIDW8xQWJucWZ6RD5U4yKUuK8s0ES\r
+       AiCJjNI8uF5YXL9iFAd6RZh3K0gVDzAlwHW/AhrMBDRYlz0QZHBJIkJKqoFRN2Lr1KmMX3av\r
+       mmq3TfThsscSwChcJx4ftHCO/OLNqRw3lf/OT1FYMK1olsy5s4eEzLd6TfMtbbyWVHWZbc4m\r
+       85LaVqbVsfHhiVkPfI9/bNWYUmtuOy/004P7cXNEuzhKT5xdsvytV8jSfK3QigOxszTnNC99\r
+       Uit/Oba43EDt9bspKReDyg8rsRRnJBpqMRcVJwIAEmJTBcYCAAA=\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: Mon, 07 Oct 2013 22:34:08 -0000\r
+\r
+Previously, the CLI would print a deprecation warning if a client\r
+requested any format version other than the current one.  However, if\r
+we add fields that are backwards-compatible, but want clients to be\r
+able to depend on, we need to bump the version, but that doesn't make\r
+the older version deprecated.\r
+\r
+Hence, separate out the "minimum active" version and only print a\r
+warning for requests below this version number.\r
+---\r
+ notmuch-client.h | 5 +++++\r
+ notmuch.c        | 2 +-\r
+ 2 files changed, 6 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/notmuch-client.h b/notmuch-client.h\r
+index afb0ddf..8d986f4 100644\r
+--- a/notmuch-client.h\r
++++ b/notmuch-client.h\r
+@@ -142,6 +142,11 @@ chomp_newline (char *str)\r
+ /* The minimum supported structured output format version.  Requests\r
+  * for format versions below this will return an error. */\r
+ #define NOTMUCH_FORMAT_MIN 1\r
++/* The minimum non-deprecated structured output format version.\r
++ * Requests for format versions below this will print a stern warning.\r
++ * Must be >= NOTMUCH_FORMAT_MIN and < NOTMUCH_FORMAT_CUR.\r
++ */\r
++#define NOTMUCH_FORMAT_MIN_ACTIVE 1\r
\r
+ /* The output format version requested by the caller on the command\r
+  * line.  If no format version is requested, this will be set to\r
+diff --git a/notmuch.c b/notmuch.c\r
+index 7300c21..6588003 100644\r
+--- a/notmuch.c\r
++++ b/notmuch.c\r
+@@ -125,7 +125,7 @@ by the notmuch CLI (it requires at least version %d).  You may need to\n\\r
+ upgrade your notmuch front-end.\n",\r
+                notmuch_format_version, NOTMUCH_FORMAT_MIN);\r
+       exit (NOTMUCH_EXIT_FORMAT_TOO_OLD);\r
+-    } else if (notmuch_format_version != NOTMUCH_FORMAT_CUR) {\r
++    } else if (notmuch_format_version < NOTMUCH_FORMAT_MIN_ACTIVE) {\r
+       /* Warn about old version requests so compatibility issues are\r
+        * less likely when we drop support for a deprecated format\r
+        * versions. */\r
+-- \r
+1.8.4.rc3\r
+\r