aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* cli: Framework for structured output versioningGravatar Austin Clements2012-12-16
| | | | | | | | | | | | | | | | | | | | | Currently there is a period of pain whenever we make backward-incompatible changes to the structured output format, which discourages not only backward-incompatible improvements to the format, but also backwards-compatible additions that may not be "perfect". In the end, these problems limit experimentation and innovation. This series of patches introduces a way for CLI callers to request a specific format version on the command line and to determine if the CLI does not supported the requested version (and perhaps present a useful diagnostic to the user). Since the caller requests a format version, it's also possible for the CLI to support multiple incompatible versions simultaneously, unlike the alternate approach of including version information in the output. This patch lays the groundwork by introducing a versioning convention, standard exit codes, and a utility function to check the requested version and produce standardized diagnostic messages and exit statuses.
* test: Test search's handling of subprocess errorsGravatar Austin Clements2012-12-16
|
* emacs: Use unified error handling in searchGravatar Austin Clements2012-12-16
| | | | | | This slightly changes the output of an existing test since we now report non-zero exits with a pop-up buffer instead of at the end of the search results.
* test: Test show's handling of subprocess errorsGravatar Austin Clements2012-12-16
|
* emacs: Improve error handling for notmuch-call-notmuch-jsonGravatar Austin Clements2012-12-16
| | | | | | This checks for non-zero exit status from JSON CLI calls and pops up an error buffer with stderr and stdout. A consequence of this is that show and reply now handle errors, rather than ignoring them.
* emacs: Factor out synchronous notmuch JSON invocationsGravatar Austin Clements2012-12-16
| | | | | | Previously this code was duplicated between show and reply. This factors out synchronously invoking notmuch and parsing the output as JSON.
* emacs: Use unified error handling in notmuch-call-notmuch-processGravatar Austin Clements2012-12-16
| | | | | | This makes notmuch-call-notmuch-process use the unified CLI error handling, which basically refines the error handling this function already did.
* emacs: Centralize notmuch command error handlingGravatar Austin Clements2012-12-16
| | | | | | | This provides library functions for unified handling of errors from the notmuch CLI. Follow-up patches will convert some scattered error handling to use this and add error handling where we currently ignore errors.
* contrib: pick: archive message updatedGravatar Mark Walters2012-12-15
| | | | | | | Update pick's archive message to respect notmuch-archive-tags. Also split archive message into an archiving part and a separate "then-next" part, to move more inline with show. Update the keybinding so default behaviour is unchanged.
* emacs: Fix bug in resynchronizing after a JSON parse errorGravatar Austin Clements2012-12-15
| | | | | | | | | | | | | | | Previously, if the input stream consisted only of an error message, notmuch-json-begin-compound would signal a (wrong-type-argument number-or-marker-p nil) error when reaching the end of the error message. This happened because notmuch-json-scan-to-value would think that it reached a value and put the parser into the 'value state. Even after notmuch-json-begin-compound signaled the syntax error, the parser would remain in this state and when the resynchronization logic reached the end of the buffer, the parser would fail because the 'value state indicates that characters are available. This fixes this problem by restoring the parser's previous state if it encounters a syntax error.
* perf-test: use nmbug tags in dump-restore testsGravatar David Bremner2012-12-15
| | | | | | | | | | | This makes the tag set a bit less trivial. Note that if you use the small corpus, this is not so interesting (and is also a bit noisy) since the messages will not be found. In the future this could be checked for. Conflicts: performance-test/01-dump-restore
* perf-test: split basic into 00-new, 01-dump-restore, and 02-tagGravatar David Bremner2012-12-15
| | | | | We use the new "time_start" function to restore the database from cache if possible.
* perf-test: unpack tags.Gravatar David Bremner2012-12-15
| | | | | There is only one set of tags, independant of the size of message corpus chosen.
* perf-test: bump corpus version to 0.3Gravatar David Bremner2012-12-15
| | | | | The new version ships with some tags, and an updated archive of the notmuch mailing list.
* perf-test: update READMEGravatar David Bremner2012-12-15
| | | | Describe new argument parsing and mention cache handling routines.
* perf-test: add caching of xapian databaseGravatar David Bremner2012-12-15
| | | | | The caching and uncaching seem to be necessarily manual, as timing the initial notmuch new is one of our goals with this suite.
* perf-test: cache unpacked corpusGravatar David Bremner2012-12-15
| | | | | Unpacking is not really the expensive step (compared to the initial notmuch new), but this is a pre-requisite to caching the database.
* perf-test: optionally print description for each group of testsGravatar David Bremner2012-12-15
| | | | | Output from tests is indented slightly in the same style as the correctness tests.
* perf-test: add corpus size to output, compact I/O statsGravatar David Bremner2012-12-14
| | | | | | | | | Austin suggested a while ago that the corpus size be printed in the header. In the end it seems the corpus will be fixed per test script, so this suggestion indeed makes sense. The tabbing was wrapping on my usual 80 column terminal, so I joined the input and output columns together.
* perf-test: add argument parsing for performance testsGravatar David Bremner2012-12-14
| | | | | This patch just sets (non-exported) variables. The variable $debug is already used, and $corpus_size will be used in following commits.
* perf-test: propagate non-zero returns from /usr/bin/timeGravatar David Bremner2012-12-14
| | | | | | Unlike in the correctness tests, the most common cause of non-zero return seems to be the user interrupting, so killing the run seems like the friendly thing to do.
* test: emacs: new tests "notmuch-show: {add,remove} multiple tags {to,from} ↵Gravatar Pieter Praet2012-12-11
| | | | | | | | | | | | | | | | single message" * test/emacs: - Rename subtests "{Add,Remove} tag from notmuch-show view" to "notmuch-show: {add,remove} single tag {to,from} single message" to be consistent with the following tests. - New subtest "notmuch-show: add multiple tags to single message": `notmuch-show-add-tag' ("+") can add multiple tags to a message. - New subtest "notmuch-show: remove multiple tags from single message": `notmuch-show-remove-tag' ("-") can remove multiple tags from a message.
* contrib: pick: bugfix for pick splitting the window excessivelyGravatar Mark Walters2012-12-11
| | | | | | | | | | Previously if you carried on past the last message in a pick view pick would get confused and `forget' about the split pane and would try and re-split when moving up again. This was due to faulty logic in notmuch-pick-show-message: something that should have been in the (when message) clause was not. Thanks to jrollins for the bug report.
* NEWS: under-the-hood Emacs interface fixesGravatar Tomi Ollila2012-12-10
| | | | | | | | | | | Added the following Emacs Interface NEWS entries: Catch errors bodypart insertions may throw, Improved text/calendar content handling and Disabled coding conversions when reading in `with-current-notmuch-show-message`. Thanks to Austin and David for content improvements.
* emacs: add support for stashing the thread id in show viewGravatar Jani Nikula2012-12-09
| | | | | Add a prefix argument to notmuch-show-stash-message-id to stash thread id instead of message id.
* tag-util: optimization of tag applicationGravatar David Bremner2012-12-09
| | | | | | | | | The idea is not to bother with restore operations if they don't change the set of tags. This is actually a relatively common case. In order to avoid fancy datastructures, this method is quadratic in the number of tags; at least on my mail database this doesn't seem to be a big problem.
* notmuch-{dump,restore}.1: document new format optionsGravatar David Bremner2012-12-09
| | | | | More or less arbitrarily, notmuch-dump.1 gets the more detailed description of the format.
* test/dump-restore: add test for warning/error messagesGravatar David Bremner2012-12-09
| | | | | | We want to test both that error/warning messages are generated when they should be, and not generated when they should not be. This varies between restore and batch tagging.
* test: second set of dump/restore --format=batch-tag testsGravatar David Bremner2012-12-09
| | | | | | | | These one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. We test each possible input to autodetection, both explicit (with --format=auto) and implicit (without --format).
* test: update dump-restore roundtripping test for batch-tag formatGravatar David Bremner2012-12-09
| | | | | Now we can actually round trip these crazy tags and and message ids. hex-xcode is no longer needed as it's built in.
* notmuch-restore: normalize case of error messages.Gravatar David Bremner2012-12-09
| | | | | In English, (unlike German) one does not capitalize the first word after a colon.
* notmuch-restore: add support for input format 'batch-tag'Gravatar David Bremner2012-12-09
| | | | | | | | | | | | | | | | | | | | | | This can be enabled with the new --format=batch-tag command line option to "notmuch restore". The input must consist of lines of the format: +<tag>|-<tag> [...] [--] id:<msg-id> Each line is interpreted similarly to "notmuch tag" command line arguments. The delimiter is one or more spaces ' '. Any characters in <tag> and <search-terms> MAY be hex encoded with %NN where NN is the hexadecimal value of the character. Any ' ' and '%' characters in <tag> and <msg-id> MUST be hex encoded (using %20 and %25, respectively). Any characters that are not part of <tag> or <search-terms> MUST NOT be hex encoded. Leading and trailing space ' ' is ignored. Empty lines and lines beginning with '#' are ignored. Commit message mainly stolen from Jani's batch tagging commit, to follow.
* tag-util.[ch]: New files for common tagging routinesGravatar David Bremner2012-12-09
| | | | | | | | | These are meant to be shared between notmuch-tag and notmuch-restore. The bulk of the routines implement a "tag operation list" abstract data type act as a structured representation of a set of tag operations (typically coming from a single tag command or line of input).
* util: add string-util.[ch]Gravatar David Bremner2012-12-08
| | | | | | This is to give a home to strtok_len. It's a bit silly to add a header for one routine, but it needs to be shared between several compilation units (or at least that's the most natural design).
* test: add sanity check for dump --format=batch-tag.Gravatar David Bremner2012-12-08
| | | | | It's important this does not rely on restore, since it hasn't been written yet.
* notmuch-dump: add --format=(batch-tag|sup)Gravatar David Bremner2012-12-08
| | | | | | | | | | | | | | | | sup is the old format, and remains the default, at least until restore is converted to parse this format. Each line of the batch-tag format is modelled on the syntax of notmuch tag: - "notmuch tag" is omitted from the front of the line - The dump format only uses query strings of a single message-id. - Each space seperated tag/message-id is 'hex-encoded' to remove trouble-making characters. - It is permitted (and will be useful) for there to be no tags before the query. In particular this format won't have the same problem with e.g. spaces in message-ids or tags; they will be round-trip-able.
* Updating man pages for new S-Expression output format.Gravatar Peter Feigl2012-12-08
| | | | | Add sections about the new S-Expression output format (--format=sexp) to the notmuch-search, notmuch-reply and notmuch-show man pages.
* Adding tests for --format=sexp.Gravatar Peter Feigl2012-12-08
| | | | | Add basic tests, the same as for json, for the S-Expression output format.
* Use the S-Expression structured printer in notmuch-show, notmuch-reply and ↵Gravatar Peter Feigl2012-12-08
| | | | | | | notmuch-search. This patch uses the new S-Expression printer in the notmuch CLI (show, search and reply). You can now use --format=sexp for any of them.
* Rename the -json printer functions in notmuch-reply and notmuch-show to ↵Gravatar Peter Feigl2012-12-08
| | | | | | | | | generic -sprinter functions. All the structured output functions in notmuch-reply and notmuch-show are renamed to a generic name (as they do not contain any json-specific code anyway). This patch is a preparation to actually using the new S-Expression sprinter in notmuch-reply and notmuch-show.
* Adding an S-expression structured output printer.Gravatar Peter Feigl2012-12-08
| | | | | | | | | | | | | | | This commit adds a structured output printer for Lisp S-Expressions. Later commits will use this printer in notmuch search, show and reply. The structure is the same as json, but: - arrays are written as lists: ("foo" "bar" "baaz" 1 2 3) - maps are written as p-lists: (:key "value" :other-key "other-value") - true is written as t - false is written as nil - null is written as nil [ whitespace changes by db ]
* test: use perl instead of sed -r for portabilityGravatar Jani Nikula2012-12-08
| | | | | Our OS X users report -r is not a supported option for sed. Use perl instead.
* test: wrap 'wc -l' results in arithmetic evaluation to strip whitespaceGravatar Jani Nikula2012-12-08
| | | | | This is for portability, as 'wc -l' emits whitespace on some BSD variants. Suggested by Tomi Ollila <tomi.ollila@iki.fi>.
* test: fix count testGravatar Jani Nikula2012-12-08
| | | | | | | The quoting for ${SEARCH} is broken when it's supposed to be '*', and it seems tricky to get it right. Just drop the variable and use '*' directly. Before this, none of the messages ever matched, and the test was comparing zeros.
* test: Fix UTF-8 JSON tests in Python 3Gravatar Austin Clements2012-12-08
| | | | | | | | | | | test_expect_equal_json uses json.tool from the system Python. While Python 2 wasn't picky about the encoding of stdin, Python 3 decodes stdin strictly according to the environment. Since we set LC_ALL=C for the tests, Python 3's json.tool was assuming stdin would be in ASCII and aborting when it couldn't decode the UTF-8 characters from some of the JSON tests. This patch sets the PYTHONIOENCODING environment variable to utf-8 when invoking json.tool to override Python's default encoding choice.
* Changing build tool for test/random-corpus to CXX instead of CC.Gravatar Peter Feigl2012-12-06
| | | | | | | | | | Without this change, GCC complains as follows: gcc test/random-corpus.o test/database-test.o notmuch-config.o command-line-arguments.o lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a -o test/random-corpus -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -Wl,-rpath,/usr/lib -ltalloc -lxapian /usr/bin/ld: lib/libnotmuch.a(database.o): undefined reference to symbol '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4' /usr/bin/ld: note: '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line /usr/lib/libstdc++.so.6: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make: *** [test/random-corpus] Error 1
* Adding parse-time to test/.gitignoreGravatar Peter Feigl2012-12-06
| | | | test/parse-time is a binary that is generated when running make test. It should be ignored by git.
* NEWS: removal of notmuch-foldersGravatar Jani Nikula2012-12-06
|
* emacs: show: refresh buffer did not remove overlaysGravatar Mark Walters2012-12-06
| | | | | | | | | Previously refreshing the notmuch show buffer did not remove overlays which meant that if the user refreshed a message with images the images would remain and then the new text was added after. One might have guessed that erase-buffer would have removed them but it seems not. Thus force the removal of overlays with remove-overlays.
* emacs: stash bugfixGravatar Mark Walters2012-12-06
| | | | | | Currently an attempt to stash a non-existent field (eg cc when not present) throws an error. Catch this case and give the user a warning message.