aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* emacs: jump: sort-order bugfixGravatar Mark Walters2014-09-07
| | | | | | | | | | | | | | | | | | | default-value needs its argument to be quoted. Slightly strangely default-value of 't or nil is 't or nil respectively so the code (default-value notmuch-search-oldest-first) just gives the current value of notmuch-search-oldest-first rather than intended default-value of this variable. The symptom is that if you are in a search buffer and use notmuch jump to run a saved search which does not have an explicitly set sort order then the sort order of the saved-search is inherited from the current search buffer rather than being the default search order. Thanks to Jani for finding the bug.
* cli: Be more helpful when .notmuch-config does not existGravatar Austin Clements2014-09-07
| | | | | | | | | | | | Previously, if the user ran any subcommand that required a configuration (e.g., notmuch new) but didn't have a configuration, notmuch would give the rather un-friendly and un-actionable message Error reading configuration file .notmuch-config: No such file or directory Since this condition is expected for new users, this patch adds specific handling for the file-not-found case to give a message that is friendly and actionable.
* doc: 'rm -f' potential doxygen temporary output fileGravatar Tomi Ollila2014-09-02
| | | | Some (older) Doxygen versions do not create such a temporary file.
* lib: Fix endless upgrade problemGravatar Austin Clements2014-09-01
| | | | | | | | | | | | | | 48db8c8 introduced a disagreement between when notmuch_database_needs_upgrade returned TRUE and when notmuch_database_upgrade actually performed an upgrade. As a result, if a database had a version less than 3, but no new features were required, notmuch new would call notmuch_database_upgrade to perform an upgrade, but notmuch_database_upgrade would return immediately without updating the database version. Hence, the next notmuch new would do the same, and so on. Fix this by ensuring that the upgrade-required logic is identical between the two.
* lib: Update doc of notmuch_database_{needs_upgrade,upgrade}Gravatar Austin Clements2014-08-30
| | | | | | Clients are no longer required to call these functions after opening a database in read/write mode (which is good, because almost none of them do!).
* lib: Return an error from operations that require an upgradeGravatar Austin Clements2014-08-30
| | | | | | | | | | | | | | | | | Previously, there was no protection against a caller invoking an operation on an old database version that would effectively corrupt the database by treating it like a newer version. According to notmuch.h, any caller that opens the database in read/write mode is supposed to check if the database needs upgrading and perform an upgrade if it does. This would protect against this, but nobody (even the CLI) actually does this. However, with features, it's easy to protect against incompatible operations on a fine-grained basis. This lightweight change allows callers to safely operate on old database versions, while preventing specific operations that would corrupt the database with an informative error message.
* lib: Support empty header values in databaseGravatar Austin Clements2014-08-30
| | | | | | | | | | | | | | | | | Commit 567bcbc2 introduced support for storing various headers in document values. However, doing so in a backwards-compatible way meant that genuinely empty header values could not be distinguished from the old behavior of not storing the headers at all, so these required parsing the original message. Now that we have database features, new databases can declare that all messages have header values, so if we have this feature flag, we can use the stored header value even if it's the empty string. This requires slight cleanup to notmuch_message_get_header, since the code previously couldn't distinguish between empty headers and headers that are never stored in the database (previously this distinction didn't matter).
* lib: Report progress for combined upgrade operationGravatar Austin Clements2014-08-30
| | | | | | | | | Previously, some parts of upgrade didn't report progress and for others it was possible for the progress meter to restart at 0 part way through the upgrade because each stage was reported separately. Fix this by computing the total amount of work that needs to be done up-front and updating completed work monotonically.
* lib: Reorganize upgrade around document typesGravatar Austin Clements2014-08-30
| | | | | | | | Rather than potentially making multiple passes over the same type of data in the database, reorganize upgrade around each type of data that may be upgraded. This eliminates code duplication, will make multi-version upgrades faster, and will let us improve progress reporting.
* lib: Use database features to drive upgradeGravatar Austin Clements2014-08-30
| | | | | | Previously, we had database version information hard-coded in the upgrade code. Slightly re-organize the upgrade process around the set of new database features to be enabled by the upgrade.
* lib: Simplify upgrade code using a transactionGravatar Austin Clements2014-08-30
| | | | | | | | | | | | Previously, the upgrade was organized as two passes -- an upgrade pass, and a separate cleanup pass -- so the database was always in a valid state. This change substantially simplifies this code by performing the upgrade in a transaction and combining both passes in to one. This 1) eliminates a lot of duplicate code between the passes, 2) speeds up the upgrade process, 3) makes progress reporting more accurate, 4) eliminates the potential for stale data if the upgrade is interrupted during the cleanup pass, and 5) makes it easier to reason about the safety of the upgrade code.
* test: Tests for future version and unknown feature handlingGravatar Austin Clements2014-08-30
|
* test: Tool to build DB with specific version and featuresGravatar Austin Clements2014-08-30
| | | | This will let us test basic version and feature handling.
* lib: Database version 3: Introduce fine-grained "features"Gravatar Austin Clements2014-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, our database schema was versioned by a single number. Each database schema change had to occur "atomically" in Notmuch's development history: before some commit, Notmuch used version N, after that commit, it used version N+1. Hence, each new schema version could introduce only one change, the task of developing a schema change fell on a single person, and it all had to happen and be perfect in a single commit series. This made introducing a new schema version hard. We've seen only two schema changes in the history of Notmuch. This commit introduces database schema version 3; hopefully the last schema version we'll need for a while. With this version, we switch from a single version number to "features": a set of named, independent aspects of the database schema. Features should make backwards compatibility easier. For many things, it should be easy to support databases both with and without a feature, which will allow us to make upgrades optional and will enable "unstable" features that can be developed and tested over time. Features also make forwards compatibility easier. The features recorded in a database include "compatibility flags," which can indicate to an older version of Notmuch when it must support a given feature to open the database for read or for write. This lets us replace the old vague "I don't recognize this version, so something might go wrong, but I promise to try my best" warnings upon opening a database with an unknown version with precise errors. If a database is safe to open for read/write despite unknown features, an older version will know that and issue no message at all. If the database is not safe to open for read/write because of unknown features, an older version will know that, too, and can tell the user exactly which required features it lacks support for.
* new: Don't report version after upgradeGravatar Austin Clements2014-08-30
| | | | | | | | | | The version number has always been pretty meaningless to the user and it's about to become even more meaningless with the introduction of "features". Hopefully, the database will remain on version 3 for some time to come; however, the introduction of new features over time in version 3 will necessitate upgrades within version 3. It would be confusing if we always tell the user they've been "upgraded to version 3". If the user wants to know what's new, they should read the news.
* completion: fail silently if _init_completion is not foundGravatar Jani Nikula2014-08-22
| | | | | | | | | | | The completion script depends on bash-completion 1.90 or later, with _init_completion function. If that's not present, for some reason, the completion currently fails with an ugly message, messing up user's command line: $ notmuch -bash: _init_completion: command not found It's better to just not complete
* Make parsing of References and In-Reply-To header less error proneGravatar Michal Sojka2014-08-16
| | | | | | | | | | | | | | | | According to RFC2822 References and In-Reply-To headers are supposed to contain one or more Message-IDs, however older RFC822 allowed almost any content. When both References and In-Reply-To headers ends with something else that a Message-ID (see e.g. [1]), the thread structure presented by notmuch is incorrect. The reason is that notmuch treats this case as if the email contained no "replyto" information (see _notmuch_database_link_message_to_parents). This patch changes the parse_references() function to return the last valid Message-ID encountered rather than NULL resulting from the last hunk of text not being the Message-ID. [1] https://lkml.org/lkml/headers/2014/5/19/864
* Add test for incorrect threading of messagesGravatar Michal Sojka2014-08-16
| | | | | | This happens when there is some garbage after the last Message-ID in the References header. See for example https://lkml.org/lkml/headers/2014/5/19/864.
* emacs: Improved compatibility for window-body-width in Emacs < 24Gravatar Austin Clements2014-08-16
| | | | | | | Fix byte compiler warning "Warning: the function `window-body-width' is not known to be defined." by moving our compatibility wrapper before its use and simplify the definition to a defalias for the old name of the function.
* Merge tag 'debian/0.18.1-2'Gravatar David Bremner2014-08-09
|\ | | | | | | uploaded to Debian unstable
| * debian: re-enable atomicity tests on armhfGravatar David Bremner2014-08-09
| | | | | | | | | | Commit a33ec9c seems to have fixed the problem on the armhf porterbox (harris.debian.org).
| * debian: build with emacs24 by default, disable gdb on arm64Gravatar David Bremner2014-08-09
| | | | | | | | | | | | | | | | From wookey@debian.org id:20140808012130.GT7605@stoneboat.aleph1.co.uk Fixes for the port in progress of debian to arm64.
* | notmuch-config: talloc_strdup MAILDIR and NAME environment variablesGravatar Tomi Ollila2014-08-07
| | | | | | | | | | When defined -- the pointer is soon given to talloc_free() which expects it to be allocated by talloc.
* | util: Const version of strtok_lenGravatar Austin Clements2014-08-06
| | | | | | | | | | | | | | | | | | Because of limitations in the C type system, we can't a strtok_len that can work on both const string and non-const strings. The C library solves this by taking a const char* and returning a char* in functions like this (e.g., strchr), but that's not const-safe. Solve it by introducing strtok_len_c, a version of strtok_len for const strings.
* | test: Include generated dependencies for test sourcesGravatar Austin Clements2014-08-06
| | | | | | | | | | | | | | | | Previously the build system was generating automatic header dependencies for test sources, but only smtp-dummy was in SRCS, so only its dependencies were being included. Add all of the test sources to SRCS so that the root Makefile.local includes their dependencies.
* | new: Report and abort on upgrade failureGravatar Austin Clements2014-08-06
| | | | | | | | | | Previously the return status of notmuch_database_upgrade went completely unchecked.
* | lib: Improve documentation of _notmuch_message_create_for_message_idGravatar Austin Clements2014-08-05
| | | | | | | | | | | | Clarify the state of the returned message when _notmuch_message_create_for_message_id returns NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND.
* | emacs: Expand default saved searches and add shortcut keysGravatar Austin Clements2014-08-05
| | | | | | | | | | | | This should help new users off to a better start with the addition of more sensible saved searches and default shortcut keys. Most existing users have probably customized this variable and won't be affected.
* | emacs: Introduce notmuch-jump: shortcut keys to saved searchesGravatar Austin Clements2014-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces notmuch-jump, which is like a user-friendly, user-configurable global prefix map for saved searches. This provides a non-modal and much faster way to access saved searches than notmuch-hello. A user configures shortcut keys in notmuch-saved-searches, which are immediately accessible from anywhere in Notmuch under the "j" key (for "jump"). When the user hits "j", the minibuffer immediately shows a helpful table of bindings reminiscent of a completions buffer. This code is a combination of work from myself (originally, "notmuch-go"), David Edmondson, and modifications from Mark Walters.
* | travis: Only notify IRC on success if the previous build failedGravatar Austin Clements2014-08-05
| | | | | | | | | | Without this, Travis is rather spammy. Travis will continue to notify the IRC channel on each build failure, which seems desirable.
* | lib: Fix slight misinformation in the database schema docGravatar Austin Clements2014-08-04
| | | | | | | | | | | | The database schema documentation made it sound like each mail document had exactly one on-disk message file, which hasn't been true for a long time.
* | lib: Invalidate message metadata in _notmuch_message_gen_termsGravatar Austin Clements2014-08-04
| | | | | | | | | | | | | | | | Previously, we invalidated stored message metadata in _notmuch_message_add_term and _notmuch_message_remove_term, but not in _notmuch_message_gen_terms. This doesn't currently result in any bugs because of our limited uses of _notmuch_message_gen_terms, but it may could cause trouble in the future.
* | config: read database.path from $MAILDIR if setGravatar Mark Oteiza2014-07-31
| | | | | | | | | | Try to read the config parameter database.path from $MAILDIR before falling back to $HOME/mail
* | config: read user.name from $NAME if setGravatar Mark Oteiza2014-07-31
| | | | | | | | | | Try to read the config parameter user.name from $NAME before taking the user name from /etc/passwd.
* | util: Make string-util.h C++-compatibleGravatar Austin Clements2014-07-31
| |
* | emacs: Clarify that notmuch-poll-script is deprecatedGravatar Austin Clements2014-07-31
| | | | | | | | | | | | | | | | | | notmuch-poll-script has long since been deprecated in favor of post-new hooks, but this wasn't obvious from the documentation. Update the documentation to make this clear. Since notmuch-poll-script could, to some extend, be used to control the path of the notmuch binary and that use is now clearly discouraged, promote notmuch-command to a real defcustom instead of just a variable.
* | emacs: show: make return value of notmuch-show-get-prop explicitGravatar Mark Walters2014-07-30
| | | | | | | | | | This makes the fact the notmuch-show-get-prop returns nil if the major mode is neither show not tree explicit.
* | dump: make dump take Xapian write lockGravatar Mark Walters2014-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dump currently only takes the read lock. Xapian can cope with some changes while maintaining a read snapshot but with more changes it fails. Currently notmuch just gives a xapian error. To avoid this we take the write lock when dumping. This prevents other notmuch processes from modifying the xapian database preventing this error. Discussion with Olly on irc indicates that this is currently the best solution: in xapian trunk there may be better possibilities using snapshots but they need to make it to a release and propogate out to users before we can switch approach. Finally, this breaks one use case: pipelines of the form notmuch dump | ... | notmuch restore According to Olly this is already very fragile: it will only work on small databases. One of the tests relies on this behaviour so fix that to store the dump rather than use a pipe.
* | nmbug: Handle missing @upstream in is_unmergedGravatar W. Trevor King2014-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't have an upstream, there is nothing to merge, so nothing is unmerged. This avoids errors like: $ nmbug status error: No upstream configured for branch 'master' error: No upstream configured for branch 'master' fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' 'git rev-parse @{upstream}' exited with nonzero value You might not have an upstream if you're only using nmbug locally to version-control your tags.
* | test: Test thread linking in all possible delivery ordersGravatar Austin Clements2014-07-16
| | | | | | | | | | | | | | | | | | | | | | | | These tests deliver all possible (single-root) four-message threads in all possible orders and check that notmuch successfully links them into threads. These tests supersede and replace the previous and much less thorough "T260-thread-order" tests. There are two variants of the test: one delivers messages that reference only their immediate parent and the other delivers messages that reference all of their parents. The latter test is currently known-broken.
* | Enable Travis-CI as a backup continuous integration service.Gravatar Wael M. Nasreddine2014-07-16
| | | | | | | | You can access the dashboard at https://travis-ci.org/notmuch/notmuch
* | emacs: tree/show remove duplicate functionGravatar Mark Walters2014-07-16
| | | | | | | | | | | | | | tree overrides notmuch-show-get-prop so that it can use many of the utility function directly. Now that tree is in mainline the version from tree can be moved to show and the original overridden show version dropped.
* | nmbug: Add a git_with_status helper functionGravatar W. Trevor King2014-07-16
| | | | | | | | | | | | Sometimes we want to catch Git errors and handle them, instead of dying with an error message. This lower-level version of git() allows us to get the error status when we want it.
* | emacs: set default in notmuch-read-queryGravatar Mark Walters2014-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the current query as a "default value" to notmuch-read-qeury. The default value is available via a down-arrow as opposed to history which is available from the up arrow. Note if a user presses return in the minibuffer this value is not returned. The implementation is simple but notmuch-read-query could be called via notmuch-search/notmuch-tree etc from any buffer so it makes sense to put the decision of how to extract the current query in notmuch-read-query rather than in each of the callers.
* | nmbug-status: Optionally load the header and footer templates from the configGravatar W. Trevor King2014-07-15
| | | | | | | | For folks that don't like the default templates for whatever reason.
* | nmbug-status: Add the time to the footer's build-dateGravatar W. Trevor King2014-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our repository [1] has a post-update hook that rebuilds the status page after each push. Since that may happen several times a day, we might as well show the build time (as well as the date) in the footer. The trailing 'Z' is the ISO 8601 designator for UTC. Now that we're showing times, it's nice to be explicit about the timezone we're using. The rename from date -> datetime gives us backward-compatibility for folks that *do* only want the date. We keep the old date formatting to support those folks. [1]: http://nmbug.tethera.net/git/nmbug-tags.git
* | nmbug-status: Factor out header/footer context into a shared dictGravatar W. Trevor King2014-07-15
| | | | | | | | | | | | | | Rather than splitting this context into header-only and footer-only groups, just dump it all in a shared dict. This will make it easier to eventually split the header/footer templates out of this script (e.g. if we want to load them from the config file).
* | Move the generated date from the top of the page to the footer.Gravatar Carl Worth2014-07-15
| | | | | | | | | | | | | | | | | | | | | | | | It's useful reference information, but anyone who wants it will look for and find it. We don't need this front-and-center. Follow the pattern set by our header template with a triple-quoted string. The gray <hr> styling is less agressive. IE uses 'color' for drawing the rule, while Gecko and Opera use the border or 'background-color' [1]. [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=239386
* | Add a docstring describing the programGravatar Carl Worth2014-07-15
| | | | | | | | | | | | | | | | | | Prefer a docstring to a header comment so we can use it as the ArgumentParser description (formatted with 'nmbug-status --help'). Script readers still have it near the top of the file. Since it's a docstring, use PEP 257's summary-line-and-body format [1]. [1]: http://legacy.python.org/dev/peps/pep-0257/#multi-line-docstrings
* | Add explicit license informationGravatar Carl Worth2014-07-15
| | | | | | | | | | It's nice to have for situations where this script is found outside of the notmuch source repository (e.g. after being installed).