unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Mazieres <dm-list-email-notmuch@scs.stanford.edu>,
	notmuch@notmuchmail.org
Subject: Re: Enabling and disabling maildir.synchronize_flags
Date: Sun, 16 Aug 2015 14:57:54 +0200	[thread overview]
Message-ID: <87614ffl0t.fsf@maritornes.cs.unb.ca> (raw)
In-Reply-To: <874mjzblwc.fsf@ta.scs.stanford.edu>

David Mazieres <dm-list-email-notmuch@scs.stanford.edu> writes:


> So my question remains, what's the easiest safe way to re-enable
> synchronize_flags after disabling it?  (Safe meaning it won't change any
> tags.)  It could be that there's a very simple answer, in which case
> sticking it in the man page might be nice.

I can't think of a simple, safe, and fast answer.

As a hack, if you run notmuch new right before you enable
synchronize_flags, then next the next notmuch new will not notice the
fact that flags are out of sync [1]. I don't think this really qualifies
as safe, as the fact that the maildir is out of sync with the database
will eventually bite you. Maybe in some special circumstances this
helps.

Otherwise, two things to that might speed up the process.

1) dump and restore both take queries, so you can only worry about the
maildir relevant flags.

2) when the lastmod changes go in, it seems like you could run the first
   notmuch new after enabling tag synchonizing, and dump only the tag
   changes since a checkpoint lastmod value. This would allow rolling
   back the unwanted tag changes.


[1]: see this potential test, if for some reason we wanted to
     guarantee this behaviours.
     
test_begin_subtest "Turning on maildir.synchronize_flags w/o backup"
OLDCONFIG=$(notmuch config get maildir.synchronize_flags)

notmuch config set maildir.synchronize_flags true
add_message [subject]='"Message to test ignoring flags"' \
    [date]='"Sat, 01 Jan 2000 12:00:00 -0000"' \
    [filename]='ignoring-flags' [dir]=cur
${NOTMUCH_NEW}
notmuch dump > EXPECTED

notmuch config set maildir.synchronize_flags false
# make flags out of sync with db
mv ${MAIL_DIR}/cur/ignoring-flags ${MAIL_DIR}/cur/ignoring-flags,S
${NOTMUCH_NEW}

notmuch config set maildir.synchronize_flags true
${NOTMUCH_NEW}
notmuch dump > OUTPUT
notmuch config set maildir.synchronize_flags "${OLDCONFIG}"
test_expect_equal_file EXPECTED OUTPUT

  reply	other threads:[~2015-08-16 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 19:58 Enabling and disabling maildir.synchronize_flags dm-list-email-notmuch
2015-08-16  9:39 ` David Bremner
2015-08-16  9:52   ` David Mazieres
2015-08-16 12:57     ` David Bremner [this message]
     [not found]       ` <87vbcf9ge1.fsf@ta.scs.stanford.edu>
2015-08-16 19:34         ` dm-list-email-notmuch

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=87614ffl0t.fsf@maritornes.cs.unb.ca \
    --to=david@tethera.net \
    --cc=dm-list-email-notmuch@scs.stanford.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).