aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* emacs: Query Emacs display table to determine ellipsis stringHEADmasterGravatar Benjamin Barenblat2014-10-20
| | | | | | | | Emacs has a slot in its display table, 'selective-display, which it uses to store the character(s) it displays when text gets elided. This commit ensures notmuch does not assume that string is ‘...’ – instead, notmuch examines the display table and bases computations on its actual contents.
* test: check for gdb in insert testsGravatar David Bremner2014-10-18
| | | | | Commits a6cee01 and c48b12f otherwise break the build for people without gdb.
* test/insert: check that indexing errors are accepted with --keepGravatar David Bremner2014-10-18
| | | | | This is overkill for the current code path, but should provide some robustness for future changes in error handling.
* cli/insert: require succesful message indexing for success statusGravatar Jani Nikula2014-10-18
| | | | | | Add --keep option to keep any remaining stuff in index or file. We could distinguish between failures to index and failures to apply tags or maildir sync, but for simplicity just have one.
* cli/insert: add fail path to add_file_to_databaseGravatar Jani Nikula2014-10-18
| | | | | | | Handle failures gracefully in add_file_to_database, renamed simply add_file while at it. Add keep option to not remove the message from database if tagging or tag syncing to maildir flags fails. Expand the function documentation to cover the changes.
* test/insert: add known broken tests for indexing failuresGravatar David Bremner2014-10-18
| | | | | These tests are written with the assumption that we want all indexing failures to be considered as failures by notmuch insert.
* lib: Handle empty date valueGravatar Austin Clements2014-10-11
| | | | | | In the interest of robustness, avoid undefined behavior of sortable_unserialise if the date value is missing. This shouldn't happen now, but ghost messages will have blank date values.
* lib: Refactor _notmuch_database_link_messageGravatar Austin Clements2014-10-11
| | | | | | This moves the code to retrieve and clear the metadata thread ID out of _notmuch_database_link_message into its own function. This will simplify future changes.
* lib: Move message ID compression to _notmuch_message_create_for_message_idGravatar Austin Clements2014-10-11
| | | | | | | | Previously, this was performed by notmuch_database_add_message. This happens to be the only caller currently (which is why this was safe), but we're about to introduce more callers, and it makes more sense to put responsibility for ID compression in the lower-level function rather than requiring each caller to handle it.
* NEWS: mention the change in default build flagsGravatar David Bremner2014-10-08
| | | | | | It blows things up by a factor of six or so, so it's worth giving people a heads up. It won't effect e.g. Debian, that already builds with -g and then strips.
* NEWS: Document "nmbug: Translate to Python"Gravatar W. Trevor King2014-10-08
| | | | | | | | | | | | | | | For more details, see the commit message for 7f2cb3be (nmbug: Translate to Python, 2014-10-03). I realized while writing this that the 7f2cb3be commit message has: * 'nmbug log' now execs 'git log', as there's no need to keep the Python process around once we've launched Git there. But we dropped that exec in favor of the subprocess approach between v3 and v4, I just forgot to update the commit message [1]. [1]: id:e630b6763e9d0771718afee41ea15b29bb4a1de8.1409935538.git.wking@tremily.us http://article.gmane.org/gmane.mail.notmuch.general/19007
* hex-escape: remove unused variable default_buf_sizeGravatar Jani Nikula2014-10-05
| | | | | | | | | | | Found by clang: CC -O2 util/hex-escape.o util/hex-escape.c:28:21: warning: unused variable 'default_buf_size' [-Wunused-const-variable] static const size_t default_buf_size = 1024; ^ 1 warning generated.
* test: Port atomicity test to PythonGravatar Austin Clements2014-10-05
| | | | | | | | Previously, this was implemented using a horrible GDB script (because there is no such thing as a non-horrible GDB script). This GDB script often broke with newer versions of GDB for mysterious reasons. Port the test script to GDB's Python API, which makes the code much cleaner and, hopefully, more stable.
* configure: add debug flags by default.Gravatar David Bremner2014-10-05
| | | | | | This makes development (in particular the test suite) easier. Those concerned about the extra diskspace can override the default or use strip.
* test: check for debug symbols in notmuchGravatar David Bremner2014-10-05
| | | | | | | | | In the future, tests may rely on debug symbols being present in notmuch, so we plan to switch the default flags. The main purpose of this test is to help explain the perhaps mysterious failures of other tests which rely on symbols being present.
* nmbug: Translate to PythonGravatar W. Trevor King2014-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to capture stdout and stderr separately, and do other explicit subprocess manipulation without resorting to external packages. It should be compatible with Python 2.7 and later (including the 3.x series). Most of the user-facing interface is the same, but there are a few changes, where reproducing the original interface was too difficult or I saw a change to make the underlying Git UI accessible: * 'nmbug help' has been split between the general 'nmbug --help' and the command-specific 'nmbug COMMAND --help'. * Commands are no longer split into "most common", "other useful", and "less common" sets. If we need something like this, I'd prefer workflow examples highlighting common commands in the module docstring (available with 'nmbug --help'). * 'nmbug commit' now only uses a single argument for the optional commit-message text. I wanted to expose more of the underlying 'git commit' UI, since I personally like to write my commit messages in an editor with the notes added by 'git commit -v' to jog my memory. Unfortunately, we're using 'git commit-tree' instead of 'git commit', and commit-tree is too low-level for editor-launching. I'd be interested in rewriting commit() to use 'git commit', but that seemed like it was outside the scope of this rewrite. So I'm not supporting all of Git's commit syntax in this patch, but I can at least match 'git commit -m MESSAGE' in requiring command-line commit messages to be a single argument. * The default repository for 'nmbug push' and 'nmbug fetch' is now the current branch's upstream (branch.<name>.remote) instead of 'origin'. When we have to, we extract this remote by hand, but where possible we just call the Git command without a repository argument, and leave it to Git to figure out the default. * 'nmbug push' accepts multiple refspecs if you want to explicitly specify what to push. Otherwise, the refspec(s) pushed depend on push.default. The Perl version hardcoded 'master' as the pushed refspec. * 'nmbug pull' defaults to the current branch's upstream (branch.<name>.remote and branch.<name>.merge) instead of hardcoding 'origin' and 'master'. It also supports multiple refspecs if for some crazy reason you need an octopus merge (but mostly to avoid breaking consistency with 'git pull'). * 'nmbug log' now execs 'git log', as there's no need to keep the Python process around once we've launched Git there. * 'nmbug status' now catches stderr, and doesn't print errors like: No upstream configured for branch 'master' The Perl implementation had just learned to avoid crashing on that case, but wasn't yet catching the dying subprocess's stderr. * 'nmbug archive' now accepts positional arguments for the tree-ish and additional 'git archive' options. For example, you can run: $ nmbug archive HEAD -- --format tar.gz I wish I could have preserved the argument order from 'git archive' (with the tree-ish at the end), but I'm not sure how to make argparse accept arbitrary possitional arguments (some of which take arguments). Flipping the order to put the tree-ish first seemed easiest. * 'nmbug merge' and 'pull' no longer checkout HEAD before running their command, because blindly clobbering the index seems overly risky. * In order to avoid creating a dirty index, 'nmbug commit' now uses the default index (instead of nmbug.index) for composing the commit. That way the index matches the committed tree. To avoid leaving a broken index after a failed commit, I've wrapped the whole thing in a try/except block that resets the index to match the pre-commit treeish on errors. That means that 'nmbug commit' will ignore anything you've cached in the index via direct Git calls, and you'll either end up with an index matching your notmuch tags and the new HEAD (after a successful commit) or an index matching the original HEAD (after a failed commit).
* doc: build notmuch-emacs info/html docs, link from indexGravatar David Bremner2014-10-04
| | | | | | | Although this manual is far from complete, it may be helpful for someone. In particular building it as part of the standard build process makes it easier to find problems when editing the notmuch-emacs-manual.
* doc: Emacs manual improvements and expansionsGravatar Austin Clements2014-10-04
| | | | | Fix several typos, improve general wording and flow, and add some information on notmuch-jump.
* NEWS: News for notmuch-jumpGravatar Austin Clements2014-10-04
|
* lib: Simplify close and codify aborting atomic sectionGravatar Austin Clements2014-10-03
| | | | | | | | | | | | | | | | | | | | | In Xapian, closing a database implicitly aborts any outstanding transaction and commits changes. For historical reasons, notmuch_database_close had grown to almost, but not quite duplicate this behavior. Before closing the database, it would explicitly (and unnecessarily) commit it. However, if there was an outstanding transaction (ie atomic section), commit would throw a Xapian exception, which notmuch_database_close would unnecessarily print to stderr, even though notmuch_database_close would ultimately abort the transaction anyway when it called close. This patch simplifies notmuch_database_close to explicitly abort any outstanding transaction and then just call Database::close. This works for both read-only and read/write databases, takes care of committing changes, unifies the exception handling path, and codifies aborting outstanding transactions. This is currently the only way to abort an atomic section (and may remain so, since it would be difficult to roll back things we may have cached from rolled-back modifications).
* cli/insert: rehash file writing functionsGravatar Jani Nikula2014-09-24
| | | | | | | Make the function calls make more sense as independent building blocks of the big picture, with clear inputs and outputs. Split up write_message into two. Improve function documentation. Cleanup and clarify the error paths.
* cli/insert: abstract temporary filename generationGravatar Jani Nikula2014-09-24
| | | | | | This will clean up the usage. There's the slight functional change of potentially ending up doing extra gethostname and getpid calls, but this is neglible.
* cli/insert: use a single recursive mkdir functionGravatar Jani Nikula2014-09-24
| | | | | | | Combine make_directory() and make_directory_and_parents() into a single recursive mkdir_recursive() function. Clarify the code and improve error handling. Improve error messages. Switch to using the new function in maildir_create_folder(). Constify talloc context.
* cli/insert: clean up sync_dirGravatar Jani Nikula2014-09-24
| | | | | Clarify the code slightly, improve error messages. Apart from the error message changes, no functional changes.
* cli/insert: rename file copy functionGravatar Jani Nikula2014-09-24
| | | | | | The copying has nothing to do with stdin, so call it copy_fd instead. While at it, improve documentation and reverse the parameters, as destination is traditionally the first parameter.
* cli/insert: move add_file_to_database to a better placeGravatar Jani Nikula2014-09-24
| | | | | | Move add_file_to_database around to keep the filesystem related functions grouped together, improving readability. No functional changes.
* cli/insert: rename check_folder_name to is_valid_folder_nameGravatar Jani Nikula2014-09-24
| | | | | | An "is something" predicate conveys the meaning better. While at it, improve the function documentation and error message. Besides the error message change, no functional changes.
* lib: actually return failures from notmuch_message_tags_to_maildir_flagsGravatar Jani Nikula2014-09-24
| | | | | The function takes great care to preserve the first error status it encounters, yet fails to return that status to the caller. Fix it.
* emacs: jump: fix compile warning on emacs 23Gravatar Mark Walters2014-09-24
| | | | | | | | | | | | | | | | | | | | | | notmuch-jump uses window-body-width which is not defined in emacs 23. To get around this it does (unless (fboundp 'window-body-width) ;; Compatibility for Emacs pre-24 (defalias 'window-body-width 'window-width)) This makes sure window-body-width is defined and all should be well. But it seems that the byte compiler does not realise that this guarantees that window-body-width will be defined and so, when compiling with emacs 23, it gives an error In end of data: notmuch-jump.el:172:1:Warning: the function `window-body-width' is not known to be defined. Domo and I came to following on irc: wrap the (unless (fboundp ...)) inside eval-and-compile which ensures that both the test and the defalias (if needed) happen at both compile and load time. This fixes the warning.
* python: Add binding for notmuch_query_add_tag_excludeGravatar Thibaut Horel2014-09-23
| | | | | Implemented as the method `exclude_tag` of the class `Query`. This method takes one argument, a string containing the name of the tag to exclude.
* emacs: Fix coding system in `notmuch-show-view-raw-message'Gravatar Austin Clements2014-09-21
| | | | | This fixes the known-broken test of viewing 8bit messages added by the previous commit.
* test: New tests for Emacs charset handlingGravatar Austin Clements2014-09-21
| | | | | | The test of viewing 8bit messages is known-broken. The rest pass, but for very fragile reasons. The next several commits will fix the known-broken test and make our charset handling robust.
* emacs: Remove redundant NTH argument from `notmuch-get-bodypart-content'.Gravatar Austin Clements2014-09-21
| | | | | | This can be derived from the PART argument (which is arguably canonical), so there's no sense in giving the caller an extra foot gun.
* test/emacs: globally force the html renderer to html2textGravatar David Bremner2014-09-21
| | | | | | Previously we did this for a single test, but some other proposed tests ( id:1398105468-14317-3-git-send-email-amdragon@mit.edu ) show similar breakage when switching renderers.
* debian: re-enable atomicity test on arm64Gravatar David Bremner2014-09-20
| | | | | | | | | according to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757454 the kernel problem which caused this test to fail should be fixed now
* debian: bump SONAMEGravatar David Bremner2014-09-16
| | | | | | Note that this is one of those cases where an ABI change is not obvious from the symbols file. Several previously void functions now have return codes.
* python: bump SONAMEGravatar David Bremner2014-09-16
| | | | | | | This should have happened in commit 6754ad9f9, but oops. This was not caught by our test suite because it uses an installed notmuch library of it cannot find the just built one.
* cli: refactor insertGravatar Peter Wang2014-09-16
| | | | | | Change insert_message into write_message and move its responsibilities for indexing the message into the main function, to simplify the control flow.
* ruby: handle return status of database closeGravatar Peter Wang2014-09-16
| | | | Throw an exception if notmuch_database_destroy fails.
* go: add return status to database close methodGravatar Peter Wang2014-09-16
| | | | | Add return status to the Database.Close() method that calls notmuch_database_destroy.
* python: handle return status of database close and destroyGravatar Peter Wang2014-09-16
| | | | | Throw an exception if notmuch_database_close or notmuch_database_destroy fail.
* lib: bump sonameGravatar Peter Wang2014-09-16
| | | | | Adding return values to notmuch_database_close and notmuch_database_destroy may require bumping the soname.
* test: simplify T360-symbol-hiding, use nm instead of objdumpGravatar David Bremner2014-09-13
| | | | | | | | | | | | | | | After yet another variation in objdump output caused this test to fail (on a Debian port, no less), I decided whatever putative benefit we get from looking at the object files instead of the library isn't worth the maintenence headache. This version uses nm -P. nm -P should be portable, and fixed format. It purposely doesn't use the -D argument, since that is non-POSIX and nm on GNU/Linux seems do the right thing without it. It still won't work out of the box on e.g. Mac OS/X. I think the right thing to do there is to move some more configuration information into sh.config.
* notmuch_thread_get_authors: document match grouping with |Gravatar Gaute Hope2014-09-13
| | | | | | | | | | | | | | as stated in thread.cc:115 /* Construct an authors string from matched_authors_array and * authors_array. The string contains matched authors first, then * non-matched authors (with the two groups separated by '|'). Within * each group, authors are listed in date order. */ this is, however, not reflected in the public API documentation in notmuch.h:970. This patch a paragraph explaining how | separates the group of authors of messages matching the query and those of messages that do not, but are still contained in the thread.
* 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.