[PATCH 1/2] test thread breakage when messages are removed and re-added

2016-04-02 Thread David Bremner
From: Daniel Kahn Gillmor This test (T590-thread-breakage.sh) currently fails! If you have a two-message thread where message "B" is in-reply-to "A", notmuch rightly sees this as a single thread. But if you: * remove "A" from the message store * run "notmuch new" * add "A" back into the mes

[PATCH 2/2] test: add test-binary to print the number of ghost messages

2016-04-02 Thread David Bremner
This one-liner seems preferable to the complications of depending on delve, getting the binary name right and parsing the output. --- I wasn't sure where exactly you wanted to count ghosts, so here is some example code to do the counting. Feel free to modify to suit your purposes. test/Makefile.

[PATCH v2 7/7] complete ghost-on-removal-when-shared-thread-exists

2016-04-02 Thread Daniel Kahn Gillmor
To fully complete the ghost-on-removal-when-shared-thread-exists proposal, we need to clear all ghost messages when the last active message is removed from a thread. --- lib/message.cc | 20 1 file changed, 20 insertions(+) diff --git a/lib/message.cc b/lib/message.cc index f

[PATCH v2 6/7] On deletion, replace with ghost when other active messages in thread

2016-04-02 Thread Daniel Kahn Gillmor
There is no need to add a ghost message upon deletion if there are no other active messages in the thread. Also, if the message being deleted was a ghost already, we can just go ahead and delete it. --- lib/message.cc | 58 ++ 1 file changed

[PATCH v2 3/7] fix thread breakage via ghost-on-removal

2016-04-02 Thread Daniel Kahn Gillmor
ghost-on-removal the solution to T590-thread-breakage.sh that just adds a ghost message after removing each message. It leaks information about whether we've ever seen a given message id, but it's a fairly simple implementation. Note that _resolve_message_id_to_thread_id also introduces new messa

[PATCH v2 1/7] test thread breakage when messages are removed and re-added

2016-04-02 Thread Daniel Kahn Gillmor
This test (T590-thread-breakage.sh) currently fails! If you have a two-message thread where message "B" is in-reply-to "A", notmuch rightly sees this as a single thread. But if you: * remove "A" from the message store * run "notmuch new" * add "A" back into the message store * re-run "notmuc

[PATCH v2 5/7] Introduce _notmuch_message_has_term()

2016-04-02 Thread Daniel Kahn Gillmor
It can be useful to easily tell if a given message has a given term associated with it. --- lib/message.cc| 49 + lib/notmuch-private.h | 13 + 2 files changed, 62 insertions(+) diff --git a/lib/message.cc b/lib/message.cc index

[PATCH v2 4/7] Add internal functions to search for alternate doc types

2016-04-02 Thread Daniel Kahn Gillmor
Publicly we are only exposing the non-ghost documents (of "type" "mail"). But internally we might want to inspect the ghost messages as well. This changeset adds two new private interfaces to queries to recover information about alternate document types. --- lib/notmuch-private.h | 10 ++

[PATCH v2 2/7] verify during thread-breakage that messages are removed as well

2016-04-02 Thread Daniel Kahn Gillmor
One risk of fixes to the thread-breakage problem is that we could fail to remove the search term indexes entirely. These additional subtests should guard against that. --- test/T590-thread-breakage.sh | 17 + 1 file changed, 17 insertions(+) diff --git a/test/T590-thread-breakage

Re: Breaking a really long thread

2016-04-02 Thread David Mazieres
David Bremner writes: > David Mazieres writes: > >> Is there any way to break an existing thread (so as to start over with a >> smaller thread), or otherwise to tweak the threading rules so that a >> particular References header gets ignored. > > Currently there is no way to do this, as threads

Re: Breaking a really long thread

2016-04-02 Thread David Bremner
David Mazieres writes: > Is there any way to break an existing thread (so as to start over with a > smaller thread), or otherwise to tweak the threading rules so that a > particular References header gets ignored. Currently there is no way to do this, as threads are "stateless" i.e. created on