[PATCH v3 15/16] added notmuch_message_reindex

David Bremner david at tethera.net
Sun Feb 28 06:52:03 PST 2016


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:

> +    const char *autotags[] = {
> +		    "attachment",
> +		    "encrypted",
> +		    "signed",
> +		    "index-decrypted",
> +		    "index-decryption-failed" };

Hmm. Is this really the only place these values are needed? That's a bit
surprising to me.

> +    /* cache tags and filenames */
> +    tags = notmuch_message_get_tags(message);
> +    filenames = notmuch_message_get_filenames(message);
> +    orig_filenames = notmuch_message_get_filenames(message);
> +    
> +    /* walk through filenames, removing them until the message is gone */
> +    for ( ; notmuch_filenames_valid (filenames);
> +	  notmuch_filenames_move_to_next (filenames)) {
> +	filename = notmuch_filenames_get (filenames);

What's the expected lifetime of the tags, filenames, and orig_filenames
lists? I guess they live until message dies. Are we expecting message to
die fairly quickly in the usual case?

> +    
> +    /* re-add the filenames with the associated indexopts */
> +    for (; notmuch_filenames_valid (orig_filenames);
> +	 notmuch_filenames_move_to_next (orig_filenames)) {
> +	filename = notmuch_filenames_get (orig_filenames);
> +
> +	status = notmuch_database_add_message_with_indexopts(notmuch,
> +							     filename,
> +							     indexopts,
> +							     readded ? NULL : &newmsg);

I guess you thought about this already, but I take it you made an
intentional choice to (attempt to) reindex all the files rather than use
_notmuch_message_add_file_name?




More information about the notmuch mailing list