Michael J Gruber [Sun, 14 Aug 2022 15:22:17 +0000 (17:22 +0200)]
test: increase cffi timeout
By default, the test suite uses 2min for other tests and 5s for cffi
tests. Sporadically, this leads to test failures caused by the timeout
on slower or loaded test infrastructure (as seen on ppc64le in Fedora's
infrastructure during branch time).
Embedding seems defensible since the file is evidently not changing
that much, and we need to change some labels to make it fit with the
not-just-emacs nature of notmuch docs.
David Bremner [Sat, 30 Jul 2022 23:45:49 +0000 (20:45 -0300)]
doc/notmuch: merge two sections on external commands.
When adding the description of the propagation of NOTMUCH_CONFIG, I
missed that there was already a section on external commands, with a
different title.
Tomi Ollila [Sun, 31 Jul 2022 17:32:11 +0000 (20:32 +0300)]
notmuch.c: add missing trailing newlines in two error messages
Removed duplicate error check (and the message) in 3rd case where
the same error message (w/o trailing newline) was present.
In case of test/T040-setup.sh, command substitution deletes
trailing newlines, so related test there cannot be changed
(and therefore could not notice this user experience flaw).
David Bremner [Fri, 1 Jul 2022 21:45:45 +0000 (18:45 -0300)]
emacs/show: provide notmuch-show-choose-duplicate
This new command allows the user to interactively choose a different
duplicate (file) to display for a given message in
notmuch-show-mode. Since both tree and unthreaded view use
notmuch-show-mode, this provides the same facility there.
David Bremner [Fri, 1 Jul 2022 21:45:44 +0000 (18:45 -0300)]
CLI/show: support --duplicate for structured output
This introduces a new mandatory key for message structures, namely
"duplicate". Per convention in devel/schemata this does _not_ increase
the format version. This means that clients are responsible for
checking that it exists, and not crashing if it does not.
The main functional change is teaching mime_node_open to understand a
'duplicate' argument.
Support for --duplicate in notmuch-reply would make sense, but we
defer it to a later commit.
David Bremner [Sat, 2 Jul 2022 23:45:11 +0000 (20:45 -0300)]
CLI/git: current cache contents of index
Rather than shelling out once per message to get the list of files
corresponding to tags, it is much faster (although potentially a bit
memory intensive) to read them all at once.
David Bremner [Fri, 1 Jul 2022 16:14:29 +0000 (13:14 -0300)]
doc/emacs: add notmuch-show-empty-saved-searches to manual
Answering a user question, I had to dig for this variable, but I think
it is a reasonably common customization wish, particularly for users
with custom count-functions.
David Bremner [Thu, 30 Jun 2022 12:00:43 +0000 (09:00 -0300)]
doc: reorganize sphinx toctree
This mainly affects the html output (although users generating epub or
pdf would also notice a change). The goal is twofold: make the TOC a
bit friendler and easier to navigate by introducing some hierarchy,
and allow links for nmbug and notmuch-setup.
David Bremner [Fri, 1 Jul 2022 11:23:24 +0000 (08:23 -0300)]
doc: improve config item labels in info output
Commit 306b7028d added the nmconfig role / directive. Unfortunately
the default of using the directive name in texinfo output is pretty
ugly, so attempt to make it more human readable by passing `objname`
to add_object_type invocation.
David Bremner [Tue, 28 Jun 2022 01:02:03 +0000 (22:02 -0300)]
emacs/show: obey notmuch-show-max-text-part-size for part 0
This parameter was originally introduced to hide large attachements
that happened to be text/plain. From a performance point of view,
there is no reason not to also hide large message bodies.
David Bremner [Tue, 28 Jun 2022 01:02:01 +0000 (22:02 -0300)]
perf-test/emacs: test showing longish threads
This particular thread takes about 100 times longer to display in
emacs than on the command line.
The parameter notmuch-show-max-text-part-size exists, but is currently
ineffective for this task because it only hides attachments, not
part 0.
In future commits, the parameter notmuch-show-{depth,height}-limit
will trigger a similar kind of hiding for bodies as
n-s-m-text-part-size already does for attachments.
David Bremner [Thu, 23 Jun 2022 12:30:44 +0000 (09:30 -0300)]
CL/git: add format version 1
The original nmbug format (now called version 0) creates 1
subdirectory of 'tags/' per message. This causes problems for more
than (roughly) 100k messages.
Version 1 introduces 2 layers of hashed directories. This scheme was
chose to balance the number of subdirectories with the number of extra
directories (and git objects) created via hashing.
This should be upward compatible in the sense that old repositories
will continue to work with the updated notmuch-git.
David Bremner [Sun, 16 Jan 2022 15:25:10 +0000 (11:25 -0400)]
test: known broken test for top level .notmuch in split configs
In split configurations there is no special significance to a top
level directory called .notmuch in the mail root. Users should
therefore be able to have mail stored underneath it.
David Bremner [Fri, 1 Jul 2022 21:45:40 +0000 (18:45 -0300)]
test: use notmuch_json_show_sanitize more places
This makes the tests more robust against changing output formats, by
allowing us to centralize fixes in the sanitization function. It is
not appropriate for all cases, in particular it is unneeded when using
test_json_nodes, and unhelpful when testing filenames.
David Bremner [Fri, 1 Jul 2022 01:14:20 +0000 (22:14 -0300)]
doc: replace symlink with copies for nmbug, notmuch-setup
Previously only man page aliases were being added as symlinks. The
addition to man_pages in conf.py automatically propagates to the list
of generated info pages.
Installation of the new pages is handled by existing recipes.
David Bremner [Tue, 28 Jun 2022 11:50:55 +0000 (08:50 -0300)]
emacs: mark notmuch-query.el as obsolete
The only functionality actually used by notmuch is the base function
notmuch-query-get-threads; the other functions in this file have
nothing to do with that (single) use. Move that function into
notmuch-lib.el and rename to reflect use. Deprecate the other
functions in notmuch-query.el.
David Bremner [Wed, 15 Jun 2022 12:14:47 +0000 (09:14 -0300)]
lib/sexp: add parameter expansion for regex and wildcard
Fix the bug reported at [1].
The parameter expansion for regex and wildcard modifiers has to be
done a bit differently, because their arguments are not s-expressions
defining complete Xapian queries.
David Bremner [Sat, 4 Jun 2022 21:53:56 +0000 (18:53 -0300)]
test/sexp: one sided range searches.
The date range parsing machinery already knows how to do something
appropriate with an empty string, but the lastmod parsing blindly
tries to parse each atom as a number.
David Bremner [Wed, 25 May 2022 10:51:16 +0000 (07:51 -0300)]
lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable
In order for a database to actually be writeable, it must be the case that it
is open, not just the correct type of Xapian object. By explicitely
checking, we are able to provide better error reporting, in particular
for the previously broken test in T566-lib-message.
David Bremner [Wed, 25 May 2022 10:51:14 +0000 (07:51 -0300)]
lib/tag: handle NULL argument to notmuch_tags_valid
Make the behaviour when passed NULL consistent with
notmuch_filenames_valid. The library already passes the result of
notmuch_message_get_tags without checking for NULL, so it should be
handled.
David Bremner [Wed, 25 May 2022 10:51:13 +0000 (07:51 -0300)]
test: add known broken test for notmuch_tags_valid (NULL)
This should return false, but currently segfaults.
Start a new file for tags library API related tests. This is maybe
overkill, but new C boilerplate which doesn't corrupt the database is
needed anyway.
David Bremner [Mon, 23 May 2022 23:38:54 +0000 (20:38 -0300)]
test: define test_private_C
When testing error handling, it is sometimes difficult to cover a
particular error path deterministically. Introduce a test function to
allow calling lower level functions directly.
David Bremner [Sat, 4 Jun 2022 11:11:19 +0000 (08:11 -0300)]
CLI: set NOTMUCH_CONFIG in hooks.
This addresses a bug report / feature request of Uwe Kleine-König. The
assumption is that we always load a config file in the CLI (i.e. we
never pass "" as the config file argument to
notmuch_database_open_with_config).
David Bremner [Mon, 30 May 2022 11:38:19 +0000 (08:38 -0300)]
test: add known broken tests for setting NOTMUCH_CONFIG in hooks
Setting this according to --config was requested by Uwe
Kleine-König. There are some other ways that the configuration file
might be found in current notmuch, so check those as well.
As a bonus, fix a bug in the hook tests that left NOTMUCH_CONFIG set
even though a config file was provided via NOTMUCH_PROFILE.
David Bremner [Sat, 14 May 2022 18:25:47 +0000 (15:25 -0300)]
CLI/git: add safety checks for checkout and commit
Commits or checkouts that modify a large fraction of the messages in
the database should be relatively rare (and in some automated process,
probably non-existent). For initial setup, where such operations are
expected, the user can pass --force.