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 B7EB3431FB6 for ; Sat, 23 Aug 2014 20:58:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 7y6cedmaRur0 for ; Sat, 23 Aug 2014 20:58:46 -0700 (PDT) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 04C07431FAF for ; Sat, 23 Aug 2014 20:58:45 -0700 (PDT) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1XLOx0-0003OC-Gh; Sun, 24 Aug 2014 00:58:42 -0300 Received: (nullmailer pid 14459 invoked by uid 1000); Sun, 24 Aug 2014 03:58:38 -0000 From: David Bremner To: Austin Clements , notmuch@notmuchmail.org Subject: Re: [PATCH v3 04/13] lib: Database version 3: Introduce fine-grained "features" In-Reply-To: <87fvgmg0tx.fsf@awakening.csail.mit.edu> References: <1406859003-11561-1-git-send-email-amdragon@mit.edu> <1406859003-11561-5-git-send-email-amdragon@mit.edu> <87ppfqsv8s.fsf@maritornes.cs.unb.ca> <87fvgmg0tx.fsf@awakening.csail.mit.edu> User-Agent: Notmuch/0.18.1+72~g028c560 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Sat, 23 Aug 2014 20:58:38 -0700 Message-ID: <87zjeu4jyp.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain 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: Sun, 24 Aug 2014 03:58:50 -0000 Austin Clements writes: >>> @@ -1048,7 +1164,8 @@ notmuch_database_get_version (notmuch_database_t *notmuch) >>> notmuch_bool_t >>> notmuch_database_needs_upgrade (notmuch_database_t *notmuch) >>> { >>> - return notmuch->needs_upgrade; >>> + return notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE && >>> + (NOTMUCH_FEATURES_CURRENT & ~notmuch->features); >>> } >> >> Maybe I'm not thinking hard enough here, but how does this deal with a >> feature that is needed to open a database in read only mode? Maybe it >> needs a comment for people not as clever as Austin ;). > > I'm not quite sure what you mean. notmuch_database_needs_upgrade > returns false for read-only databases because you can't upgrade a > read-only database. This was true before this patch, too, though it was > less obvious. (Maybe that's not what you're asking?) Yes, that's what I was asking. I guess it's orthogonal to your patch series, but the logic of returning FALSE for read only databases is not very intuitive to me (in the sense that "needs upgrade" is not the opposite of "can't be upgraded". Your new comment later in the series is better, but it would IMHO be even better if you mentioned the read only case. d