Re: [PATCH 07/20] cli/show: emit new whole-message crypto status output

Subject: Re: [PATCH 07/20] cli/show: emit new whole-message crypto status output

Date: Fri, 29 Jun 2018 11:41:25 -0400

To: David Bremner, Notmuch Mail

Cc:

From: Daniel Kahn Gillmor


On Fri 2018-06-15 20:47:59 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>
>> +
>> +	const _notmuch_message_crypto_t *msg_crypto = mime_node_get_message_crypto_status (node);
>> +	if (msg_crypto->sig_list ||
>> +	    msg_crypto->decryption_status != NOTMUCH_MESSAGE_DECRYPTED_NONE) {
>> +	    sp->map_key (sp, "crypto");
>
> I believe the new stuff needs to guarded by
>
> if (notmuch_format_version >= 5)

hm, maybe it can all still be v4?  over in notmuch-client.h, it says:

    /* The current structured output format version.  Requests for format
     * versions above this will return an error.  Backwards-incompatible
     * changes such as removing map fields, changing the meaning of map
     * fields, or changing the meanings of list elements should increase
     * this.  New (required) map fields can be added without increasing
     * this.
     */
    #define NOTMUCH_FORMAT_CUR 4

i don't know exactly what "map fields" means here -- i don't think of
notmuch-show output as a "map" but maybe i'm using the terminology
wrong.

and, despite the comments above, the versioning actually looks like
this:

    Version history
    ---------------

    v1
    - First versioned schema release.
    - Added part.content-length and part.content-transfer-encoding fields.

    v2
    - Added the thread_summary.query field.

    v3
    - Replaced message.filename string with a list of filenames.
    - Added part.content-disposition field.

    v4
    - replace signature error integer bitmask with a set of flags for
      individual errors.


So we have bumped from 1 to 2 with just a simple addition in the past.
But maybe that was from before we knew better?

At any rate, since the only thing that we're doing is emitting
message.crypto, i think we can avoid bumping the version in this series.

That said, i think i need to wrap the block with a test for
(notmuch_format_version >= 4) in this case, right?

My new series will try out something like this, let me know what you
think!

          --dkg
signature.asc (application/pgp-signature)
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: