unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
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	[thread overview]
Message-ID: <1382627951-25252-3-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1382627951-25252-1-git-send-email-amdragon@mit.edu>

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

  parent reply	other threads:[~2013-10-24 15:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 15:19 [PATCH v2 00/11] Fix search tagging races Austin Clements
2013-10-24 15:19 ` [PATCH v2 01/11] schemata: Disambiguate non-terminal names Austin Clements
2013-10-24 15:19 ` Austin Clements [this message]
2013-10-24 15:19 ` [PATCH v2 03/11] lib: Document extent of some return values Austin Clements
2013-10-24 15:19 ` [PATCH v2 04/11] test: Fix missing erase-buffer in emacs test Austin Clements
2013-10-24 15:19 ` [PATCH v2 05/11] emacs: Move `notmuch-call-notmuch-process' to notmuch-lib Austin Clements
2013-10-24 15:19 ` [PATCH v2 06/11] emacs: Support passing input via `notmuch-call-notmuch-*' Austin Clements
2013-10-24 15:19 ` [PATCH v2 07/11] emacs: Use notmuch tag --batch for large tag queries Austin Clements
2013-10-24 15:19 ` [PATCH v2 08/11] search: Add stable queries to thread search results Austin Clements
2013-10-24 15:19 ` [PATCH v2 09/11] Add TODO about more efficient stable thread queries Austin Clements
2013-10-24 15:19 ` [PATCH v2 10/11] emacs: Add known-broken tests for search tagging races Austin Clements
2013-10-24 15:19 ` [PATCH v2 11/11] emacs: Fix " Austin Clements
2013-10-25 23:10 ` [PATCH v2 00/11] " Mark Walters
2013-11-07 17:26 ` Tomi Ollila
2013-11-09  1:00 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382627951-25252-3-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).