aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
Commit message (Collapse)AuthorAge
...
* | Fix folder: coherence issueGravatar Mark Anderson2011-06-29
| | | | | | | | | | | | | | | | | | | | Add removal of all ZXFOLDER terms to removal of all XFOLDER terms for each message filename removal. The existing filename-list reindexing will put all the needed terms back in. Test search-folder-coherence now passes. Signed-off-by:Mark Anderson <ma.skies@gmail.com>
| * libnotmuch: build symbols list without relying on gcc -aux-info.Gravatar David Bremner2011-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Carl reports "gcc -aux-info notmuch.aux lib/notmuch.h" does not generate notmuch.aux for him with Debian gcc 4.6.0-8. A small modification of the original sed regular expression allows us to work directly from lib/notmuch.h, rather than preprocessing with gcc. As with most such simple regex based "parsing", this is quite sensitive to the input format, and needs that each symbol to be exported from libnotmuch should - start with "notmuch_" - be the first non-whitespace token on the line - be followed by an open parenthesis. (Cherry-picked from 51b7ab69687, with conflicts resolved by db)
* | libnotmuch: build symbols list without relying on gcc -aux-info.Gravatar David Bremner2011-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Carl reports "gcc -aux-info notmuch.aux lib/notmuch.h" does not generate notmuch.aux for him with Debian gcc 4.6.0-8. A small modification of the original sed regular expression allows us to work directly from lib/notmuch.h, rather than preprocessing with gcc. As with most such simple regex based "parsing", this is quite sensitive to the input format, and needs that each symbol to be exported from libnotmuch should - start with "notmuch_" - be the first non-whitespace token on the line - be followed by an open parenthesis.
* | libnotmuch: fix typos in CLEAN setting, add fileGravatar David Bremner2011-06-28
| | | | | | | | | | | | | | - c0961e6 introduced a missing slash between $(dir)$(LIBNAME) and missing $(dir) in front of libnotmuch.a - cdf1c70a created a file $(dir)/notmuch.h.gch and neglected to add it to CLEAN
* | fix sum moar typos [comments in source code]Gravatar Pieter Praet2011-06-23
| | | | | | | | | | | | | | | | | | | | Various typo fixes in comments within the source code. Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just source-code comments, (and fixed fix of "descriptios" to "descriptors" rather than "descriptions").
* | fix sum moar typos [build scripts, Makefiles]Gravatar Pieter Praet2011-06-23
|/ | | | | | | | Various typo fixes in comments within the Makefile and other build scripts. Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just build files.
* libnotmuch: add linker script to declare only notmuch_* symbols as global.Gravatar David Bremner2011-06-23
| | | | | | | | | | | This is closely tied to gcc and particularly gnu ld, but I guess the shared library linking code would need to be adjusted to work on a non-gnu linker anyay. I had to make a few not-obviously related changes to the lib/Makefile.local to make this work: libnotmuch_modules is defined with := and used in place of $^ (cherry picked from commit 014bf85b1c06ff49be2bde5a26433d2cf376cf70)
* Fix appending of Received headersGravatar Stewart Smith2011-06-10
| | | | | | | We're not properly concatenating the Received headers if we parse them while requesting a header that isn't Received. this fixes notmuch-reply address detection in a bunch of situations.
* lib/message-file: plug three memleaks.Gravatar Anton Khirnov2011-06-03
| | | | Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* tag signed/encrypted during notmuch newGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | This patch adds the tag "signed" to messages with any multipart/signed parts, and the tag "encrypted" to messages with any multipart/encrypted parts. This only occurs when messages are indexed during notmuch new, so a database rebuild is required to have old messages tagged.
* Mark some structures in the library interface with visibility=default attribute.Gravatar Carl Worth2011-05-11
| | | | | | | | | | | | | As of gcc 4.6, there are new warnings from -Wattributes along the lines of: warning: ‘_notmuch_messages’ declared with greater visibility than the type of its field ‘_notmuch_messages::iterator’ [-Wattributes] To squelch these, we decorate all such containing structs with __attribute__((visibility("default"))). We take care to let only the C++ compiler see this, (since the C compiler would otherwise warn about ignored visibility attributes on types).
* Remove some variables which were set but not used.Gravatar Carl Worth2011-05-11
| | | | | | | | | | | | gcc (at least as of version 4.6.0) is kind enough to point these out to us, (when given -Wunused-but-set-variable explicitly or implicitly via -Wunused or -Wall). One of these cases was a legitimately unused variable. Two were simply variables (named ignored) we were assigning only to squelch a warning about unused function return values. I don't seem to be getting those warnings even without setting the ignored variable. And the gcc docs. say that the correct way to squelch that warning is with a cast to (void) anyway.
* Fixup string list authorGravatar Austin Clements2011-03-21
|
* Add the tag list to the unified message metadata pass.Gravatar Austin Clements2011-03-21
| | | | | | | | | | | | | Now each caller of notmuch_message_get_tags only gets a new iterator, instead of a whole new list. In principle this could cause problems with iterating while modifying tags, but through the magic of talloc references, we keep the old tag list alive even after the cache in the message object is invalidated. This reduces my index search from the 3.102 seconds before the unified metadata pass to 1.811 seconds (1.7X faster). Combined with the thread search optimization in b3caef1f0659dac8183441357c8fee500a940889, that makes this query 2.5X faster than when I started.
* Add the file name list to the unified message metadata pass.Gravatar Austin Clements2011-03-21
| | | | | | | | | | | | | Even if the caller never uses the file names, there is little cost to simply fetching the file name terms. However, retrieving the full paths requires additional database work, so the expansion from terms to full paths is performed lazily. This also simplifies clearing the filename cache, since that's now handled by the generic metadata cache code. This further reduces my inbox search from 3.102 seconds before the unified metadata pass to 2.206 seconds (1.4X faster).
* Add a generic function to get a list of terms with some prefix.Gravatar Austin Clements2011-03-21
| | | | | | Replace _notmuch_convert_tags with this and simplify _create_filenames_for_terms_with_prefix. This will also come in handy shortly to get the message file name list.
* Implement an internal generic string list and use it.Gravatar Austin Clements2011-03-21
| | | | | | | | | | | | This replaces the guts of the filename list and tag list, making those interfaces simple iterators over the generic string list. The directory, message filename, and tags-related code now build generic string lists and then wraps them in specific iterators. The real wins come in later patches, when we use these for even more generic functionality. As a nice side-effect, this also eliminates the annoying dependency on GList in the tag list.
* Use a single unified pass to fetch scalar message metadata.Gravatar Austin Clements2011-03-21
| | | | | | | | | | This performs a single pass over a message's term list to fetch the thread ID, message ID, and reply-to, rather than requiring a pass for each. Xapian decompresses the term list anew for each iteration, so this reduces the amount of time spent decompressing message metadata. This reduces my inbox search from 3.102 seconds to 2.555 seconds (1.2X faster).
* Merge remote branch 'amdragon/search-perf-3'Gravatar Carl Worth2011-03-10
|\
* | build: Add support for non-source-directory builds.Gravatar Carl Worth2011-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Such as: mkdir build cd build ../configure make This is implemented by having the configure script set a srcdir variable in Makefile.config, and then sprinkling $(srcdir) into various make rules. We also use vpath directives to convince GNU make to find the source files from the original source directory.
| * Simplify _notmuch_doc_id_set_init interface.Gravatar Austin Clements2011-01-30
| | | | | | | | | | | | Don't require the caller of _notmuch_doc_id_set_init to pass in a correct bound; instead compute it from the array. This simplifies the caller and makes this interface easier to use correctly.
| * Remove code repetition in the doc ID bitmap code.Gravatar Austin Clements2011-01-30
|/ | | | | | Remove the repeated "sizeof (doc_ids->bitmap[0])" that bothered cworth by instead defining macros to compute the word and bit offset of a given bit in the doc ID set bitmap.
* Makefile: Quote variables used as filenames in shell commandsGravatar Carl Worth2011-01-26
| | | | This allows support for filenames with spaces in them.
* lib: Save and restore term position in message while indexing.Gravatar Carl Worth2011-01-26
| | | | | This fixes the recently addead search-position-overlap bug as demonstrated in the test of the same name.
* notmuch search: Clean up some memory leaks during search loop.Gravatar Carl Worth2011-01-26
| | | | | | | | | | With talloc, we were already freeing all memory by the time we exited the loop, but that didn't help with excess use of memory inside the loop, (which was mostly from tallocing some objects with the incorrect parent). Thanks to Andrew Tridgell for sitting next to me and teaching me to use talloc_report_full to find these leaks.
* Add support for folder-based searching.Gravatar Carl Worth2011-01-15
| | | | | | | | A new "folder:" prefix in the query string can now be used to match the directories in which mail files are stored. The addition of this feature causes the recently added search-by-folder tests to now pass.
* Tighten up a memory allocation.Gravatar Carl Worth2011-01-15
| | | | | | Using the local talloc context ensures that the memory we are using here will be freed shortly, (rather than hanging on for a long time with the notmuch database object).
* Correct some minor typos in a commentGravatar Carl Worth2011-01-15
| | | | | Nothing too important here. Just some misspellings I noticed while reading nearby code.
* Optimize thread search using matched docid sets.Gravatar Austin Clements2010-12-07
| | | | | | | | | | | | | | | | | This reduces thread search's 1+2t Xapian queries (where t is the number of matched threads) to 1+t queries and constructs exactly one notmuch_message_t for each message instead of 2 to 3. notmuch_query_search_threads eagerly fetches the docids of all messages matching the user query instead of lazily constructing message objects and fetching thread ID's from term lists. _notmuch_thread_create takes a seed docid and the set of all matched docids and uses a single Xapian query to expand this docid to its containing thread, using the matched docid set to determine which messages in the thread match the user query instead of using a second Xapian query. This reduces the amount of time required to load my inbox from 4.523 seconds to 3.025 seconds (1.5X faster).
* notmuch search: Fix to display authors in date order.Gravatar Carl Worth2010-12-07
| | | | | Previously, the authors of the thread were displayed in reverse-chronological order, which was fairly confusing.
* lib: Set thread subject at the same time as setting thread->{oldest,newest}Gravatar Carl Worth2010-12-07
| | | | | | | | | We really want to change the thread subject at the same time we set the date, (if the sort order indicates this is necessary). The previous code for setting the thread subject was sensitive on the query sort when adding matching messages. An independent bug fix is about to change that query sort order, so we remove the dependency on it here.
* Fix to index the "Re" term present in any subject.Gravatar Carl Worth2010-11-23
| | | | | | | | | | | This was a misfeature where notmuch had extra code that just threw away legitimate information. It was never indexing an initial "Re" term in a subject. But some users have legitimately wanted to search for this term. The original code was written this way merely for strict compatiblity with the indexing performed by sup, but we're not taking advantage of that now anyway.
* lib: Fix missing initialization of status field.Gravatar Carl Worth2010-11-11
| | | | | This could have been a problematic bug. Fortuinately "gcc -O2" warns about it.
* lib: Add two missing static qualifiersGravatar Carl Worth2010-11-11
| | | | | The debian packaging is nice enough to notice when we accidentally leak private symbols to the public interface.
* Increment library version to 1.3.0Gravatar Carl Worth2010-11-11
| | | | | | | | For the addition of three functions: notmuch_message_get_filenames notmuch_message_tags_to_maildir_flags notmuch_message_maildir_flags_to_tags
* tags_to_maildir_flags: Fix to preserve existing, unsupported flagsGravatar Carl Worth2010-11-11
| | | | | | This is to prevent notmuch from destroying any information the user has encoded as flags in the maildir filename. Tests are also added to the test suite to verify the documented behavior.
* notmuch_message_tags_to_maildir_flags: Do nothing outside of "new" and "cur"Gravatar Carl Worth2010-11-11
| | | | | | | | | | | Some people use notmuch with non-maildir files, (for example, email messages in MH format, or else cool things like using sluk[*] to suck down feeds into a format that notmuch can index). To better support uses like that, don't do any renaming for files that are not in a directory named either "new" or "cur". [*] https://github.com/krl/sluk/
* lib: Be honest in the documentation of the maildir functionsGravatar Carl Worth2010-11-11
| | | | | | | | | | I had originally hoped for better semantics, such as doing nothing in non-maildir directories, and preserving unknown maildir flags that happen to be present. We could still do those things, of course, but for now, remove them from the documentation since the implementation does not do these things yet.
* notmuch_message_tags_to_maildir_flags: Don't exit on failure to rename.Gravatar Carl Worth2010-11-11
| | | | | | It is totally legitimate for a non-maildir directory to be named "new" (and not have a directory next to it named "cur"). To support this case at least, be silent about any rename failure.
* notmuch_message_tags_to_maildir_flags: Fix to rename multiple filesGravatar Carl Worth2010-11-11
| | | | | This function was documented as modifying every filename associated with the message. Fix it to actually do that.
* notmuch_filenames_create: Take a reference to underlying filename listGravatar Carl Worth2010-11-11
| | | | | The notmuch_filenames_t object might easily outlive the original object owning the filename list. So take a talloc reference to keep things safe.
* maildir_flags_to_tags: Avoid interpreting "no info" as "no flags set".Gravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | | If a filename has no maildir info at all, (that is, it does not contain the sequence ":2,"), we consider this distinct from a filename with an empty maildir info, (the ":2," separator is present, but no flags characters follow). Specifically, we regard a missing info field as providing no information, so tags will remain unchanged. On the other hand, an info field that is present but has no flags set will cause various tags to be cleared, (or in the case of "unread", added). This fixes the "remove info" case of the maildir-sync tests in the test suite.
* lib: Document that absence of maildir flags can also remove/add tagsGravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | | Previously the documentation of notmuch_message_maildir_flags_to_tags suggested that the presence of a flag would cause tags to be added, (or in the case of "unread", removed). But the case of absent maildir flags was not explicitly described. What we actually want, is that for supported flags, the absence of the flag in all messages causes the corresponding tag to be removed, (or in the case of "unread", added). So document that explicitly. This is the case recently added to the test suite as a failing test, (so we'll need to do bug fixing before the documentation is honest here).
* Fix notmuch_message_tags_to_maildir_flags to effect rename immediatelyGravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | We have tests to ensure that when the notmuch library renames a file that that rename takes place immediately in the database, (without requiring something like "notmuch new" to notice the change). This was working when the code was first added, but recently broke in the reworking of the maildir-synchronization interface since the tags_to_maildir_flags function can no longer assume that it is being called as part of _notmuch_message_sync. Fortunately, the fix is as simple as adding an explicit call to _notmuch_message_sync.
* Fix notmuch_message_maildir_flags_to_tags to iterate over filenamesGravatar Carl Worth2010-11-11
| | | | | | | | | As documented, this function now iterates over all filenames for the message, computing a logical OR of the flags set on the filenames, then uses the final result to set tags on the message. This change fixes 3 of the 10 maildir-sync tests that have been failing since being added.
* lib: Add new, public notmuch_message_get_filenamesGravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | | | | | This augments the existing notmuch_message_get_filename by allowing the caller access to all filenames in the case of multiple files for a single message. To support this, we split the iterator (notmuch_filenames_t) away from the list storage (notmuch_filename_list_t) where previously these were a single object (notmuch_filenames_t). Then, whenever the user asks for a file or filename, the message object lazily creates a complete notmuch_filename_list_t and then: For notmuch_message_get_filename, returns the first filename in the list. For notmuch_message_get_filenames, creates and returns a new iterator for the filename list.
* lib: Add new implementation of notmuch_filenames_tGravatar Carl Worth2010-11-11
| | | | | | | | | | | | The new implementation is simply a talloc-based list of strings. The former support (a list of database terms with a common prefix) is implemented by simply pre-iterating over the terms and populating the list. This should provide no performance disadvantage as callers of thigns like notmuch_directory_get_child_files are very likely to always iterate over all filenames anyway. This new implementation of notmuch_filenames_t is in preparation for adding API to query all of the filenames for a single message.
* lib: Remove the notion of TAGS_INVALIDGravatar Carl Worth2010-11-11
| | | | | | | | This rather ugly hack was recently obviated by the removal of the notmuch_database_set_maildir_sync function. Now, clients must make explicit calls to do any syncrhonization between maildir flags and tags. So the library no longer needs to worry about doing inconsistent synchronization while a message is only partially added.
* lib: Rework interface for maildir_flags synchronizationGravatar Carl Worth2010-11-11
| | | | | | | | | | | | | Instead of having an API for setting a library-wide flag for synchronization (notmuch_database_set_maildir_sync) we instead implement maildir synchronization with two new library functions: notmuch_message_maildir_flags_to_tags and notmuch_message_tags_to_maildir_flags These functions are nicely documented here, (though the implementation does not quite match the documentation yet---as plainly evidenced by the current results of the test suite).
* lib: Remove the synchronization of 'T' flag with "deleted" tag.Gravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tags in a notmuch database affect all messages with the identical message-ID. But maildir tags affect individual files. And since multiple files can contain the identical message-ID, there is not a one-to-one correspondence between messages affected by tags and flags. This is particularly dangerous with the 'T' (== "trashed") maildir flag and the corresponding "deleted" tag in the notmuch database. Since these flags/tags are often used to trigger irreversible deletion operations, the lack of one-to-one correspondence can be potentially dangerous. For example, consider the following sequence: 1. A third-party application is used to identify duplicate messages in the mail store, and mark all-but-one of each duplicate with the 'T' flag for subsequent deletion. 2. A "notmuch new" operation reads that 'T' flag, adding the "deleted" flag to the corresponding messages within the notmuch database. 3. A subsequent notmuch operation, (such as a "notmuch dump; notmuch restore" cycle) synchronized the "deleted" tag back to the mail store, applying the 'T' flag to all(!) filenames with duplicate message IDs. 4. A third-party application reads the 'T' flags and irreversibly deletes all mail messages which had any duplicates(!). In order to avoid this scenario, we simply refuse to synchronize the 'T' flag with the "deleted" tag. Instead, applications can set 'T' and act on it to delete files, or can set "deleted" and act on it to delete files. But in either case the semantics are clear and there is never dangerous propagation through the one-to-many mapping of notmuch message objects to files.