From: David Bremner <david@tethera.net>
To: Austin Clements <amdragon@mit.edu>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH v3 04/13] lib: Database version 3: Introduce fine-grained "features"
Date: Sun, 24 Aug 2014 16:03:23 -0700 [thread overview]
Message-ID: <871ts5mqx0.fsf@maritornes.cs.unb.ca> (raw)
In-Reply-To: <20140824221629.GP3015@mit.edu>
Austin Clements <amdragon@mit.edu> writes:
> Quoth David Bremner on Aug 23 at 8:58 pm:
>> Austin Clements <amdragon@mit.edu> 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.
>
> That's a good point. Ideally this should be
> "notmuch_database_can_upgrade" or something, which I think would
> capture exactly what it means after this series. However, I don't
> think it's worth breaking API compatibility given that this is already
> how callers use this function (even though that violates the current
> library spec).
>
> So, how's this for a more updated doc comment on needs_upgrade?
LGTM
next prev parent reply other threads:[~2014-08-24 23:03 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 2:09 [PATCH v3 00/13] Implement and use database "features" Austin Clements
2014-08-01 2:09 ` [PATCH v3 01/13] test: Include generated dependencies for test sources Austin Clements
2014-08-01 2:09 ` [PATCH v3 02/13] util: Const version of strtok_len Austin Clements
2014-08-06 13:43 ` David Bremner
2014-08-01 2:09 ` [PATCH v3 03/13] new: Don't report version after upgrade Austin Clements
2014-08-23 15:39 ` Jani Nikula
2014-08-23 22:59 ` Austin Clements
2014-08-24 12:56 ` Jani Nikula
2014-08-01 2:09 ` [PATCH v3 04/13] lib: Database version 3: Introduce fine-grained "features" Austin Clements
2014-08-23 16:02 ` Jani Nikula
2014-08-24 0:57 ` Austin Clements
2014-08-23 22:21 ` David Bremner
2014-08-24 0:58 ` Austin Clements
2014-08-24 3:58 ` David Bremner
2014-08-24 22:16 ` Austin Clements
2014-08-24 23:03 ` David Bremner [this message]
2014-08-01 2:09 ` [PATCH v3 05/13] test: Tool to build DB with specific version and features Austin Clements
2014-08-23 16:03 ` Jani Nikula
2014-08-01 2:09 ` [PATCH v3 06/13] test: Tests for future version and unknown feature handling Austin Clements
2014-08-01 2:09 ` [PATCH v3 07/13] lib: Simplify upgrade code using a transaction Austin Clements
2014-08-01 2:09 ` [PATCH v3 08/13] lib: Use database features to drive upgrade Austin Clements
2014-08-01 2:09 ` [PATCH v3 09/13] lib: Reorganize upgrade around document types Austin Clements
2014-08-01 2:10 ` [PATCH v3 10/13] lib: Report progress for combined upgrade operation Austin Clements
2014-08-01 2:10 ` [PATCH v3 11/13] lib: Support empty header values in database Austin Clements
2014-08-01 2:10 ` [PATCH v3 12/13] lib: Return an error from operations that require an upgrade Austin Clements
2014-08-01 2:10 ` [PATCH v3 13/13] lib: Update doc of notmuch_database_{needs_upgrade, upgrade} Austin Clements
2014-08-07 21:55 ` [PATCH v3 00/13] Implement and use database "features" Tomi Ollila
2014-08-08 18:18 ` Austin Clements
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=871ts5mqx0.fsf@maritornes.cs.unb.ca \
--to=david@tethera.net \
--cc=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).