]> git.notmuchmail.org Git - notmuch/commitdiff
cli: Separate current and deprecated format version
authorAustin Clements <amdragon@MIT.EDU>
Thu, 24 Oct 2013 15:19:02 +0000 (11:19 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 9 Nov 2013 00:13:58 +0000 (20:13 -0400)
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
notmuch.c

index 0bfa4da9606a4b62b052aec3a42e04148bceaccf..4ecb3ae9d44c511818684b5c56ba85c2b1d0c34f 100644 (file)
@@ -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
index 8d303a14f6ca2c9a38038af8d5e8a28e98da92d6..54f46c6828cc13a72d6dec17cc264e50b4e9c231 100644 (file)
--- 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. */