aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-30cppcheck: close files during shutdownDavid Bremner
Fix the following cppcheck errors: notmuch-count.c:207: error: Resource leak: input notmuch-tag.c:238: error: Resource leak: input We know that the program is shutting down here, but it does no harm to clean up a bit.
2017-08-29build: add target to run cppcheckDavid Bremner
The advantage of having a target as opposed to running cppcheck by hand - reuse list of source files - output errors in a format parsable, e.g. by emacs - returns exit code 1 on any error, for possibly use in other targets. For the moment, leave this as an optional target. If desired, it can be added to e.g. the release targets in the same way as the test target. Using two levels of directory for the stamps is arguably overengineering, but it doesn't really cost anything, and leaves open the possibility of putting other kinds of stamp files there. This only checks "new" source files (w.r.t. their last check). A future target (cppcheck-all ?) could blow away the stamp files first.
2017-08-29build: add .deps to CLEAN instead of listing in clean targetJani Nikula
Seems, uh, cleaner this way.
2017-08-29build: add optional target parameter to quiet variable functionJani Nikula
Sometimes using $@ as the target in the quiet build lines can be confusing. Accept an optional second parameter in the quiet variable function to specify the target.
2017-08-29build: avoid an extra shell out in quiet variable functionJani Nikula
$(word 1, $1) yields the same result as the more complicated $(shell echo $1 | sed -e s'/ .*//')
2017-08-29CLI/new: support maildir synced tags in new.tagsDavid Bremner
We reorder reading maildir flags to avoid overwriting 'new.tags'. The inverted status of 'unread' means the maildir flag needs to be checked a second time. I backpedalled here on the idea of supporting 'new.tags' without 'unread' in the presence of maildir syncing. For files in 'new/', it seems quite natural to tag them as 'unread'.
2017-08-29lib: add notmuch_message_has_maildir_flagDavid Bremner
I considered a higher level interface where the caller passes a tag name rather than a flag character, but the role of the "unread" tag is particularly confusing with such an interface.
2017-08-29lib/message: split n_m_maildir_flags_tags, store maildir flagsDavid Bremner
In a future commit this will allow querying maildir flags seperately from tags to allow resolving certain conflicts.
2017-08-28test: Perform T170 tests that don't require dtach before any that do.David Edmondson
This avoids the later tests seeing different versions of the database depending on whether dtach is available.
2017-08-23notmuch-tag.el: Fix minor grammar errorVladimir Panteleev
2017-08-23test: Use small Python script for JSON normalization instead of json.toolVladimir Panteleev
json.tool does not sort or otherwise normalize the order of JSON keys in its output, which can result in test failures on some test systems. Instead, use a one-line Python script passed to the interpreter directly on its command line. Use sort_keys=True for json.dump to ensure the key order is normalized. The script works with both Python 2 and 3. * test/test-lib.sh: Update test_expect_equal_json.
2017-08-23reindex: drop notmuch_param_t, use notmuch_indexopts_t insteadDaniel Kahn Gillmor
There are at least three places in notmuch that can trigger an indexing action: * notmuch new * notmuch insert * notmuch reindex I have plans to add some indexing options (e.g. indexing the cleartext of encrypted parts, external filters, automated property injection) that should properly be available in all places where indexing happens. I also want those indexing options to be exposed by (and constrained by) the libnotmuch C API. This isn't yet an API break because we've never made a release with notmuch_param_t. These indexing options are relevant in the listed places (and in the libnotmuch analogues), but they aren't relevant in the other kinds of functionality that notmuch offers (e.g. dump/restore, tagging, search, show, reply). So i think a generic "param" object isn't well-suited for this case. In particular: * a param object sounds like it could contain parameters for some other (non-indexing) operation. This sounds confusing -- why would i pass non-indexing parameters to a function that only does indexing? * bremner suggests online a generic param object would actually be passed as a list of param objects, argv-style. In this case (at least in the obvious argv implementation), the params might be some sort of generic string. This introduces a problem where the API of the library doesn't grow as new options are added, which means that when code outside the library tries to use a feature, it first has to test for it, and have code to handle it not being available. The indexopts approach proposed here instead makes it clear at compile time and at dynamic link time that there is an explicit dependency on that feature, which allows automated tools to keep track of what's needed and keeps the actual code simple. My proposal adds the notmuch_indexopts_t as an opaque struct, so that we can extend the list of options without causing ABI breakage. The cost of this proposal appears to be that the "boilerplate" API increases a little bit, with a generic constructor and destructor function for the indexopts struct. More patches will follow that make use of this indexopts approach.
2017-08-23database: add n_d_index_file (deprecates n_d_add_message)Daniel Kahn Gillmor
We need a way to pass parameters to the indexing functionality on the first index, not just on reindexing. The obvious place is in notmuch_database_add_message. But since modifying the argument list would break both API and ABI, we needed a new name. I considered notmuch_database_add_message_with_params(), but the functionality we're talking about doesn't always add a message. It tries to index a specific file, possibly adding a message, but possibly doing other things, like adding terms to an existing message, or failing to deal with message objects entirely (e.g. because the file didn't contain a message). So i chose the function name notmuch_database_index_file. I confess i'm a little concerned about confusing future notmuch developers with the new name, since we already have a private _notmuch_message_index_file function, and the two do rather different things. But i think the added clarity for people linking against the future libnotmuch and the capacity for using index parameters makes this a worthwhile tradeoff. (that said, if anyone has another name that they strongly prefer, i'd be happy to go with it) This changeset also adjusts the tests so that we test whether the new, preferred function returns bad values (since the deprecated function just calls the new one). We can keep the deprecated n_d_add_message function around as long as we like, but at the next place where we're forced to break API or ABI we can probably choose to drop the name relatively safely. NOTE: there is probably more cleanup to do in the ruby and go bindings to complete the deprecation directly. I don't know those languages well enough to attempt a fix; i don't know how to test them; and i don't know the culture around those languages about API additions or deprecations.
2017-08-22show: workaround for the missing file problemYuri Volchkov
This patch fixes the 'Deleted first duplicate file does not stop notmuch show from working' test. If a message to be shown has several duplicated files, and for some reason the first file in the list is not available anymore, notmuch will exit with an error. This is clearly a problem in the database, but we are not going to let this problem be a show-stopper. Let's walk through the list, and show the first existing file. Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2017-08-22test: show id:<> works even if the first duplicate is deletedYuri Volchkov
Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2017-08-22insert: strip trailing / in folder pathYuri Volchkov
This patch fixes the "Insert message into folder with trailing /" test. The problem was insufficient path canonization. From database's point of view, "Sent" and "Sent/" are different folders. If user runs (note the last '/'): notmuch insert --folder=maildir/Sent/ < test.msg notmuch will create an extra XDIRECTORY record for the folder 'Sent/'. This means that database will have _TWO_ records for _ONE_ physical folder: 'Sent' and 'Sent/'. However, the 'notmuch new' command will update only records related to the first one (the correct one). Now, if user moved the email file (e.g. from 'Sent/new' to 'Sent/cur'), 'notmuch new' will add a record about the new file, but will not delete the old record. Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2017-08-22database: move striping of trailing '/' into helper functionYuri Volchkov
Stripping trailing character is not that uncommon operation. Particularly, the next patch has to perform it as well. Lets move it to the separate function to avoid code duplication. Also the new function has a little improvement: if the character to strip is repeated several times in the end of a string, function strips them all. Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2017-08-20perf-test: add memory test for notmuch-insertDavid Bremner
In the future it might be worthwhile selecting corpus messages to insert, but that seems a bit overcomplicated for now
2017-08-20perf-test: renumber testsDavid Bremner
One test per number so ordering is clear.
2017-08-20test: move generate_message, add_message into test-lib-common.shDavid Bremner
The plan is to use at least the former in the perf test suite.
2017-08-20lib: clarify description of notmuch_database_add_messageDaniel Kahn Gillmor
Since we're accumulating the index when we add a new file to the message, the semantics have slightly changed. This tries to align the documentation with the actual functionality.
2017-08-20emacs: Use make-process when availableVladimir Panteleev
make-process is a new function introduced in Emacs 25, which provides greater control over process creation. Crucially, it allows separately redirecting stderr directly to a buffer, which allows us to avoid needing to use the shell to redirect to a temporary file in order to correctly distinguish stdout and stderr. * notmuch-lib.el: Use make-process when it is available; fall back to the previous method when not.
2017-08-20emacs: Refactor subprocess stderr propagationVladimir Panteleev
Load subprocess error output to a string in the callers, and propagate the error messages as a string parameter instead of a path to file names. Required to be able to avoid using temporary files for subprocess error output. * notmuch-lib.el: Update notmuch-check-async-exit-status, notmuch-check-exit-status: accept an err parameter instead of err-file; shift the responsibility of loading error messages from files up the call stack.
2017-08-20doc: Disable SmartyPants in generated manual pagesVladimir Panteleev
By default, Sphinx tries to pre-process text through SmartyPants, which attempts to convert ASCII quotes and dashes to Unicode characters. Unfortunately, this mangles technical text such as command lines. For instance, this excerpt from notmuch-tag.rst: **notmuch** **tag** **--batch** [--input=<*filename*>] got turned into: notmuch tag –batch [–input=<filename>] That's an en-dash and an em-dash respectively. Not only are these characters visually confusing and could easily be mistaken for a single dash, copying and pasting such command lines into a terminal is doomed to result in incomprehensible error messages. * doc/conf.py: Disable SmartyPants.
2017-08-20emacs: set query-context to nil if its "" or "*"Jani Nikula
The queries "" and "*" are special cased in the notmuch library to match all messages, but only if they're the entire query. They can't be combined with other queries, such as "* AND foo", in which case they "leak" down to the Xapian query parser. Notmuch show and tree buffers inadvertently combine the thread query with said special queries, causing incorrect collapsing of messages. Handle the special queries specially. We already do a similar thing in notmuch-search-filter.
2017-08-20test: insert into the folder with trailing /Yuri Volchkov
From database's point of view, "Drafts" and "Drafts/" are different folders Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com> Amended: add test_subtest_known_broken (db)
2017-08-18completion: add bash completion for "notmuch reindex"Daniel Kahn Gillmor
The main thing that notmuch reindex does is to use search terms, so we can reuse a bunch of the existing completion framework.
2017-08-18fix typoDaniel Kahn Gillmor
2017-08-18test: remove remainder of previously killed basic testYuri Volchkov
In the commit 51cd69feb1d131db7a468e33e0fa2e043caad41e the part of the test "test runs if prerequisite is satisfied" has been removed. However, there was a remainder of that test - variable 'haveit'. Kill it, to not to confuse people. Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
2017-08-18Use rooted paths in .gitignore filesVladimir Panteleev
A leading / in paths in a .gitignore file matches the beginning of the path, meaning that for patterns without slashes, git will match files only in the current directory as opposed to in any subdirectory. Prefix relevant paths with / in .gitignore files, to prevent accidentally ignoring files in subdirectories and possibly slightly improve the performance of "git status".
2017-08-18test: Update extant references to corpus.mailVladimir Panteleev
971cdc72cdb80f060193bc0914dc9badcc29696b renamed corpus.mail to corpora.mail. Although 971cdc72cdb80f060193bc0914dc9badcc29696b updated some of the remaining corpus.mail references, two remained, causing the test suite to leave behind an unignored corpora.mail directory.
2017-08-16remove boolean "first" argument from format_part_sprinterDaniel Kahn Gillmor
This argument seems to be unused, and format_part_sprinter isn't required to meet any specific API so it seems cleaner and simpler to drop it.
2017-08-16test: add test for ,S message without 'unread' in new.tagsDavid Bremner
This is arguably overkill, but it helps to understand the complicated interactions here between maildir tags and configuration.
2017-08-16test: add missing quotes in maildir-sync test.David Bremner
Oops. ';' is significant in the shell. Who knew.
2017-08-16Merge branch 'release'David Bremner
merge in debian-only changes
2017-08-16cli/new: improve error reportingDavid Bremner
Recently a user reported a crash in notmuch new, but because of missing error reporting, all they could say was "A Xapian exception occured". This commit adds the extra information available about the error message in the exception.
2017-08-16debian: start changelog for next debian uploadDavid Bremner
2017-08-16do not use bullets in debian/NEWSDaniel Kahn Gillmor
see lintian's debian-news-entry-uses-asterisk for justification
2017-08-16remove obsolete lintian-override (see https://bugs.debian.org/865055)Daniel Kahn Gillmor
2017-08-15Merge tag 'debian/0.25-6'David Bremner
uploaded to unstable
2017-08-15debian: actually stop shipping 50notmuch.eldebian/0.25-6David Bremner
2017-08-10Merge tag 'debian/0.25-5'David Bremner
uploaded to unstable
2017-08-10debian upload 0.25-5debian/0.25-5David Bremner
fix typo in -4
2017-08-06test: add broken tests for maildir syncingDavid Bremner
Users should be able to specify synced tags in new.tags
2017-08-04Merge tag 'debian/0.25-4'David Bremner
uploaded to unstable
2017-08-04debian: upload 0.25-4debian/0.25-4David Bremner
replace notmuch-emacs with elpa-emacs as a recommend
2017-08-03Merge tag 'debian/0.25-3'David Bremner
uploaded to unstable
2017-08-03debian: changelog stanza for 0.25-3debian/0.25-3David Bremner
2017-08-03debian: add maintainer scripts to remove old startup fileDavid Bremner
We do it for notmuch and notmuch-emacs because the history is a bit unclear. It seems to be safe to call when that conffile is not owned by a given package
2017-08-01add "notmuch reindex" subcommandDaniel Kahn Gillmor
This new subcommand takes a set of search terms, and re-indexes the list of matching messages.