aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
Commit message (Collapse)AuthorAge
...
* lib: destroy message object after message removalGravatar Ali Polatel2011-10-04
| | | | | notmuch_database_remove_message() must call notmuch_message_destroy() once it is done handling message removal.
* lib: bump library minor version because of new symbols.Gravatar David Bremner2011-09-24
| | | | | This bump is because of the new symbols introduced by the atomicity patches.
* lib: Improve notmuch_database_{add,remove}_message documentation.Gravatar Austin Clements2011-09-24
| | | | | | | | State up front that these functions may add a filename to an existing message or remove only a filename (and not the message), respectively. Previously, this key information was buried in return value documentation or in "notes", which made it seem secondary to these functions' semantics.
* lib: Wrap notmuch_database_add_message in an atomic section.Gravatar Austin Clements2011-09-24
| | | | | | | | Adding a message may involve changes to multiple database documents, and thus needs to be done in a transaction. This makes add_message (and, I think, the whole library) atomicity-safe: library callers only needs to use atomic sections if they needs atomicity across multiple library calls.
* lib: Add an API to find a message by filename.Gravatar Austin Clements2011-09-24
| | | | | | | | | notmuch_database_find_message_by_filename is mostly stolen from notmuch_database_remove_message, so this patch also vastly simplfies the latter using the former. This API is also useful in its own right and will be used in a later patch for eager maildir flag synchronization.
* lib: Remove message document directly after removing the last file name.Gravatar Austin Clements2011-09-23
| | | | | | | | | | | | Previously, notmuch_database_remove_message would remove the message file name, sync the change to the message document, re-find the message document, and then delete it if there were no more file names. An interruption after sync'ing would result in a file-name-less, permanently un-removable zombie message that would produce errors and odd results in searches. We could wrap this in an atomic section, but it's much simpler to eliminate the round-about approach and just delete the message document instead of sync'ing it if we removed the last filename.
* lib: Indicate if there are more filenames after removal.Gravatar Austin Clements2011-09-23
| | | | | | Make _notmuch_message_remove_filename return NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID if the message has more filenames and fix callers to handle this.
* lib: Add support for nested atomic sections.Gravatar Austin Clements2011-09-23
| | | | | | | notmuch_database_t now keeps a nesting count and we only start a transaction or commit for the outermost atomic section. Introduces a new error, NOTMUCH_STATUS_UNBALANCED_ATOMIC.
* lib: Add notmuch_database_{begin,end}_atomic.Gravatar Austin Clements2011-09-23
| | | | | | These operations translate into non-flushed Xapian transactions, allowing arbitrary groups of database operations to be performed atomically.
* lib: Add missing status check in _notmuch_message_remove_filename.Gravatar Austin Clements2011-09-12
| | | | | | Previously, this function would synchronize the folder list even if removing the file name failed. Now it returns immediately if removing the file name fails.
* lib/gen-version-script.h: add getline and getdelim to notmuch.sym if neededGravatar David Bremner2011-09-05
| | | | | | | | If the configure script detects missing getline and/or getdelim symbols, then notmuch will use it's own versions. This patch, based on id:"87k49v12i5.fsf@pc44es141.cs.uni-magdeburg.de" by Matthias Guedemann, adds the symbols to notmuch.sym as well so they are properly exported from the library.
* lib/gen-version-script.sh: replace --defined argument to nm with awkGravatar David Bremner2011-09-05
| | | | | | | | | | OpenBSD nm apparently doesn't support --defined. The awk condition is based on the assumption that all defined symbols have some hex number in the first column. Thanks to Matthias Guedemann reporting the problem, and an earlier version of this patch.
* re-enable notmuch.sym generation using POSIX sedGravatar David Bremner2011-08-21
| | | | | | | | | Unfortunately Robin Green's patch 52e4dedf9aa was lost when I created gen-version-script.sh. This merges his changes manually into that script. It turns out tabs seem not needed in version script files, so I simplified a bit and removed the printf. Thanks to Alexander Botero-Lowry for help and testing.
* libnotmuch: only build symbols list after the modules are builtGravatar Thomas Jost2011-07-20
| | | | | | If the notmuch.sym target does not explicitly depend on $(libnotmuch_modules), gen-version-script.sh may be run before all the .o files are created, for example when doing a parallel build on a machine with many cores.
* Merge commit '0.6.1'Gravatar David Bremner2011-07-17
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/Makefile.local The conflicts are from three kinds of commits not merged into release: - typo fixes - removal of debug output - fix for CLEAN rule That were never merged into the release branch.
| * libnotmuch: export Xapian typeinfo symbolsGravatar David Bremner2011-07-16
| | | | | | | | | | | | | | | | | | | | | | The lack of such exporting seems to cause problems catching exceptions, as suggested by http://gcc.gnu.org/wiki/Visibility This manifested in the symbol-hiding test failing when notmuch was compile with gcc 4.4.5. On i386, this further manifested as notmuch new failing to run (crashing with an uncaught exception on first run).
* | Use POSIX sed invocationGravatar Robin Green2011-07-03
| | | | | | | | | | | | Fixes broken build on DragonFly BSD Signed-off-by: Robin Green <greenrd@greenrd.org>
| * 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> (cherry picked from commit 8a856e5c38b79359e4fbf9e27f58b1fe00c1e18a)
* | lib/Makefile.local: remove leftover debugging output.Gravatar David Bremner2011-06-29
| | | | | | | | | | | | The removed "echo $(libnotmuch_modules)" was strictly for debugging. Thanks to Austin Clements for the hint.
* | 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.