aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-19perf-test/T00-new: fix backup creation.David Bremner
"xargs tar cf backup.tar < $manifest" recreates the tar file with each "batch" execed by xargs. In general this results in only a fraction of the desired files being backed up.
2021-05-19doc: fix variable name in documentationLuis Henriques
Variable 'notmuch-saved-searches-sort-function' does not exist; 'notmuch-saved-search-sort-function' is the correct name. Signed-off-by: Luis Henriques <henrix@camandro.org>
2021-05-19doc: fix man page build for Sphinx 4.xJani Nikula
Sphinx 4.0 changed the default value of man_make_section_directory from False to True. We create the section directories and move the files manually, so fix the immediate man build failure by disabling the feature. The Sphinx documentation on this [1] is confusing, and has the change backwards. Git history says the default changed from False to True. [1] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-man_make_section_directory
2021-05-17test: split emacs functionality to its own fileFelipe Contreras
This way it's easier to identify the tests that do require emacs stuff. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: fix a couple of shellcheck complaintsFelipe Contreras
In test-lib-emacs.sh line 20: test_require_external_prereq ${TEST_EMACS} || ret=1 ^-----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACS}" || ret=1 In test-lib-emacs.sh line 21: test_require_external_prereq ${TEST_EMACSCLIENT} || ret=1 ^-----------------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACSCLIENT}" || ret=1 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: check for configured emacsFelipe Contreras
Commit d59d9c81 (test: Make the emacsclient binary user-configurable, 2012-11-27) modified the prereq check for the configured emacsclient, but we probably want to do the same for emacs itself. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: simplify missing dependencies checkFelipe Contreras
No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: more style fixesFelipe Contreras
In order to fit the git coding style. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: trivial style cleanupsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: new notmuch_rb_object_destroy() helperFelipe Contreras
The struct used to store the types (rb_data_type_t) contains a "data" field where we can store whatever we want. I use that field to store a pointer to the corresponding destroy function. For example notmuch_rb_database_type contains a pointer to notmuch_database_destroy. I cast that pointer as a notmuch_status_t (func*)(void *) and call that function passing the internal object (e.g. notmuch_database_t). Using the rb_data_type_t data we can call the correct notmuch destroy function. Therefore this: ret = ((notmuch_status_t (*)(void *)) type->data) (nm_object); Is effectively the same as this: ret = notmuch_database_destroy (database); The advantage of doing it this way is that much less code is necesary since each rb_data_type_t has the corresponding destroy function stored in it. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: add all data typesFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: move towards more modern RTypedDataFelipe Contreras
Virtually the whole ruby core moved from RData to RTypeData, let's do so ourselves too. Basically the information typically passed through Data_Wrap_Struct is now stored in a struct rb_data_type_t (mark and free functions). This has the advantage that more information can be easily added, like the name of the type, a custom data ponter, and more. Data_Wrap_Struct is replaced with TypedData_Wrap_Struct, and the information is stored in a struct rb_data_type_t, rather than passed as arguments. Check_Type is replaced with Check_TypedStruct, which is a wrapper for rb_check_typeddata (with casts). #define Check_TypedStruct(v, t) \ rb_check_typeddata(RBIMPL_CAST((VALUE)(v)), (t)) We can use rb_check_typeddata directly, just like we use rb_data_object_get directly. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: create Data_Wrap_Notmuch_Object helperFelipe Contreras
This makes the code more maintainable and will help in further patches. No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: add unlikely hintFelipe Contreras
The error path is very unlikely. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: fetch class name in case of errorFelipe Contreras
There is not much point in complicating the code for error messages that can be easily constructed. Before: database closed (RuntimeError) After: Notmuch::Database object destroyed (RuntimeError) Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: simplify data get helperFelipe Contreras
Data_Get_Struct is nothing but a macro that calls rb_data_object_get with a cast (unnecessary in C). #define Data_Get_Struct(obj, type, sval) \ ((sval) = RBIMPL_CAST((type*)rb_data_object_get(obj))) We can use rb_data_object_get directly, and this way we don't need to pass the type, which is unnecessary information. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-15Merge branch 'release'David Bremner
2021-05-15NEWS: finalize release datedebian/0.32.1-1archive/debian/0.32.1-10.32.1David Bremner
2021-05-15debian: changelog for 0.32.1-1David Bremner
2021-05-15version: bump to 0.32.1David Bremner
2021-05-15NEWS: add news for $HOME/mail fixDavid Bremner
2021-05-15lib/open: restore default database path of $HOME/mailDavid Bremner
Although this default worked for "notmuch config get", it didn't work most other places. Restore the previous functionality, with the wrinkle that XDG locations will shadow $HOME/mail if they exist. This fixes a bug reported by Jack Kamm in id:87eeefdc8b.fsf@gmail.com
2021-05-15NEWS: add NEWS for notmuch-{before,after}-tag-hook fixesDavid Bremner
2021-05-15emacs: restore tag-changes and query bindings for tag hooksKyle Meyer
notmuch-before-tag-hook and notmuch-after-tag-hook are supposed to have access to two dynamic variables, tag-changes and query, but these were lost with the switch to lexical binding in fc4cda07 (emacs: use lexical-bindings in all libraries, 2021-01-13). Add a variant of Emacs's dlet (not available until Emacs 28) and use it in notmuch-tag to expose tag-changes and query to the hooks.
2021-05-15test: add known broken tests for notuch-{before,after}-tag-hookDavid Bremner
These tests illustrate the bug reported in id:87v97ytd2s.fsf@fastmail.fm
2021-05-15CLI: add missing file notmuch-client-initDavid Bremner
This file should have been created in commit 5a8d174f, but wasn't.
2021-05-14CLI/notmuch: make immutable tables constDavid Bremner
Let the compiler enforce the immutability.
2021-05-14CLI: make static message strings constDavid Bremner
This is both a bit clearer and avoids the possibility of modification.
2021-05-14CLI/config: make immutable tables constDavid Bremner
Let the compiler help us catch bugs.
2021-05-14CLI: centralize initialization in notmuch_client_initDavid Bremner
Initially make sure gmime_filter_reply initialization is thread-safe (assuming notmuch_client_init is only called once). For tidyness, also put talloc initialization in the new function.
2021-05-14lib/message: mark flag2tag as constDavid Bremner
This table is intended to be immutable
2021-05-14lib/generate_thread_id: move static buffer to notmuch_database_tDavid Bremner
Work towards the goal of concurrent access to different Xapian databases from the same process.
2021-05-13lib: make glib initialization thread-safeDavid Bremner
In principle this could be done without depending on C++11 features, but these features should be available since gcc 4.8.1, and this localized usage is easy to replace if it turns out to be problematic for portability.
2021-05-12ruby: improve general data get helperFelipe Contreras
There's no need to do Check_Type, Data_Get_Struct calls rb_data_object_get(), which already does that. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-12ruby: improve all Data_Get_Notmuch_* helpersFelipe Contreras
There's no need to repeat the same code over and over. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-12ruby: add missing Data_Get_Notmuch helpersFelipe Contreras
Apparently commit 5c9e3855 (ruby: Don't barf if an object is destroyed more than once, 2010-05-26) missed these two. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-12Merge branch 'release'David Bremner
2021-05-12NEWS: add note about fix to notmuch_database_reopenDavid Bremner
2021-05-12lib/notmuch_database_reopen: reload some database metadataDavid Bremner
In some uses of reopen, new documents and threads maybe have been added, and e.g. compaction may have changed the uuid.
2021-05-12test: change database from within pre-new hookMichael J Gruber
Due to the change in the config system, notmuch keeps a notmuch database open when it would not do so before. Consequently, it can miss changes to the database which are done from a hook (while notmuch holds the databse in read only mode). When notmuch itself writes to the database after that it uses wrong assumptions about the last used doc id etc. Demonstrate this by triggering an assertion. (This new test succeeds with notmuch 0.31.4.) Signed-off-by: Michael J Gruber <git@grubix.eu> Amended-by: db. Check for both messages
2021-05-10Merge branch 'release'David Bremner
2021-05-10NEWS: start NEWS for 0.32.1David Bremner
2021-05-10doc: document database.backup_dirDavid Bremner
Most users will not need to change this, but documenting it helps preserve the interface.
2021-05-10doc: document (tersely) the intended behaviour of relative paths.David Bremner
2021-05-10test: test explicit configuration of backup directoryDavid Bremner
Including the relative path that was broken until a recent commit.
2021-05-10test: test relative paths for database.hook_dirDavid Bremner
2021-05-10lib/config: expand relative paths when reading from databaseDavid Bremner
This makes the treatment of relative paths consistent between the database and config files.
2021-05-10test: add known broken test for relative setting of mail_rootDavid Bremner
The behaviour should not change depending on where the configuration is stored.
2021-05-10lib/config: canonicalize paths relative to $HOME.David Bremner
Prior to 0.32, notmuch had the (undocumented) behaviour that it expanded a relative value of database.path with respect to $HOME. In 0.32 this was special cased for database.path but broken for database.mail_root, which causes problems for at least notmuch-new when database.path is set to a relative path. The change in T030-config.sh reflects a user visible, but hopefully harmless behaviour change; the expanded form of the paths will now be printed by notmuch config.
2021-05-10test: add known broken test for relative database path in newDavid Bremner
This test highlights a bug introduced in 0.32. The new split between path and mail_root does not properly canonicalize relative paths in the latter.