summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-24debian: bump changelog versiondebian/0.32_rc1-1archive/debian/0.32_rc1-10.32_rc1David Bremner
2021-04-24version: bump to 0.32~rc1David Bremner
2021-04-24debian: add xapian-tools for testsDavid Bremner
xapian-metadata is used by some of the new tests.
2021-04-24lib/config: remove early free in _get_email_from_passwd_fileDavid Bremner
This (obvious) bug was caused by cut&pasting the code from notmuch-config.c into the library and adding on a return at the end.
2021-04-24test: replace notmuch_passwd_sanitize with python versionDavid Bremner
Apparently the -f option to hostname is not portable, and in fact it does not seem to always behave reasonably in e.g. a chroot. Python code originally due to Tomi [1], modified by yours truly. [1]: id:m2lf9fbkug.fsf@guru.guru-group.fi
2021-04-24debian: update d/libnotmuch50.32_rc0David Bremner
This corresponds to libnotmuch 5.3. It should be backward compatible because it only adds symbols.
2021-04-24debian: start changelog for 0.32~rc0-1David Bremner
2021-04-24update version to 0.32~rc0David Bremner
2021-04-24compat: rename {,notmuch_}canonicalize_file_nameĐoàn Trần Công Danh
When compat canonicalize_file_name was introduced, it was limited to C code only because it was used by C code only during that time. >From 5ec6fd4d, (lib/open: check for split configuration when creating database., 2021-02-16), lib/open.cc, which is C++, relies on the existent of canonicalize_file_name. However, we can't blindly enable canonicalize_file_name for C++ code, because different implementation has different additional signature for C++ and users can arbitrarily add -DHAVE_CANONICALIZE_FILE_NAME=0 to {C,CXX}FLAGS. Let's move our implementation into a util library. Helped-by: Tomi Ollila <tomi.ollila@iki.fi> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-04-18ruby: fix ruby 3.1 warningsFelipe Contreras
init.c:214:5: warning: ‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1. [-Wdeprecated-declarations] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-04-18lib/n_d_index_file: check return value from _n_m_add_filenameDavid Bremner
Ignoring this return value seems like a bad idea in general, and in particular it has been hiding one or more bugs related to handling long directory names.
2021-04-18test-lib: unset XDG_CONFIG_HOMEĐoàn Trần Công Danh
lib/open.cc:_load_key_file will only open xdg-config files in $XDG_CONFIG_HOME if it's defined, $HOME/.config will be considered if and only if XDG_CONFIG_HOME not defined. Let's unset said variable before running the test.
2021-04-18lib: directly traverse postlists in _n_message_deleteDavid Bremner
This is intended to fix the slow behaviour of "notmuch new" (and possibly "notmuch reindex") when large numbers of files are deleted. The underlying issue [1] seems to be the Xapian glass backend spending a large amount of time in db.has_positions when running queries with large-ish amounts of unflushed changes. This commit removes two uses of Xapian queries [2], and replaces them with an approximation of what Xapian would do after optimizing the queries. This avoids the calls to has_positions (which are in any case un-needed because we are only using boolean terms here). [1] Thanks to "andres" on IRC for narrowing down the performance bottleneck. [2] Thanks to Olly Betts of Xapian fame for talking me a through a fix that does not require people to update Xapian.
2021-04-18perf-tests: add test for removing files.David Bremner
Without the proposed fix for deletion performance [1], this test is probably unreasonably slow compared to others at the same small/medium/large scale. [1]: id:20210414021627.1236560-3-david@tethera.net
2021-04-16test: put shim at end of LD_PRELOAD pathDavid Bremner
Certain tools like the address-sanitizer fail if they are not the first LD_PRELOADed library. It does not seem to matter for our shims, as long as they are loaded before libnotmuch.
2021-04-10NEWS: user visible config related changes for 0.32David Bremner
2021-04-06CLI: rename notmuch_config_t to notmuch_conffile_tDavid Bremner
The name is a compromise between keeping function names from getting too long, and avoiding confusion with the newer notmuch_config library API. Try to make clear that the residual functionality is only about updating configuration files.
2021-04-06CLI: drop notmuch_config_t from subcommand interface.David Bremner
At this point it is unused in all subcommands.
2021-04-06CLI/config: remove calls to notmuch_config_open from top levelDavid Bremner
This will allow simplifying the subcommand interface. Change the internal API to notmuch_config_open to not tie it to the implementation of subcommands in notmuch.c. It also fixes a previously broken test, since notmuch_config_open does not understand the notion of the empty string as a config file name.
2021-03-27CLI/config: support set/get with split configurationDavid Bremner
There are two small code changes. The main one is to retrieve the possibly updated config file name found during the database opening call. The second change is to allow empty config file names, as a (currently broken) way of specifying that configuration should only be taken from the database.
2021-03-27lib: provide notmuch_config_pathDavid Bremner
Since the library searches in several locations for a config file, the caller does not know which of these is chosen in the usual case of passing NULL as a config file. This changes provides an API for the caller to retrieve the name of the config file chosen. It will be tested in a following commit.
2021-03-27CLI+lib: detect missing database in split configurations.David Bremner
Eventually we want to do all opening of databases in the top level (main function). This means that detection of missing databases needs to move out of subcommands. It also requires updating the library to use the new NO_DATABASE status code.
2021-03-27lib: add NOTMUCH_STATUS_NO_DATABASEDavid Bremner
This will allow more precise return values from various open related functions.
2021-03-27CLI/config: default to storing all config in external filesDavid Bremner
Previously the fact that some configuration options were only stored in the database (and thus editing the config file had no effect) was a source of user confusion. This was fixed with the series ending at d9af0af1646. On the other hand, the underlying partition of config options into those stored by default in the database and those stored in the config file remained. This is also confusing, since now some invocations of "notmuch config set" modify the config file, and others silently modify the database instead. With this commit, it is up to the user to decide which configuration to modify. A new "--database" option is provided for notmuch config to enable modifying the configuration information in the database; otherwise the default is to update an external config file.
2021-03-27CLI/config: drop cached data from notmuch_config_tDavid Bremner
The idea is to preserve notmuch_config_t as a thin wrapper for GKeyFile.
2021-03-27CLI/config: drop obsolete notmuch_config_get_*David Bremner
These are no longer used, replaced by notmuch_config_get.
2021-03-27CLI/notmuch: switch notmuch_command to notmuch_config_getDavid Bremner
The goal at this point is to remove the dependence on notmuch_config_get_* without breaking any existing functionality. This is a step towards removing notmuch_config_get_* in a future commit.
2021-03-27CLI/config: use notmuch_database_reopenDavid Bremner
This allows `notmuch config` to use the common configuration information carried by the notmuch_database_t opened at the top level.
2021-03-27CLI/config: migrate notmuch_config_open to new configDavid Bremner
notmuch_config_open will be preserved in the medium term for use by the commands that are manipulating the config file directly (config and setup)
2021-03-27CLI/config: switch "notmuch config list" to merged configDavid Bremner
Use the database opened at the top level rather than opening another notmuch_database_t. Test output changes because keys are now listed in alphabetical order, and because a missing database is no longer an error.
2021-03-27CLI/setup: switch to new configuration frameworkDavid Bremner
Most of the changes are the elimination of notmuch_config_t accessor use. We also migrate some of the diagnostics to the top level where we are opening the files in question.
2021-03-27test/setup: check file output instead of notmuch config listDavid Bremner
This allows verification of comments added to new / updated config file.
2021-03-27CLI/config: use merged config for "config get"David Bremner
This commit starts the conversion of notmuch-config.c functionality (as opposed to just interface) to the new config framework. The change to T030-config is because of the move of the canonicalization database paths from the notmuch_config_t accessor to the internal function _choose_database_path.
2021-03-27CLI: load merged config at top levelDavid Bremner
This paves the way for the conversion of the remaining subcommands to the new configuration framework.
2021-03-27lib/open: canonicalize relative path read from config fileDavid Bremner
This matches functionality in the the CLI function notmuch_config_get_database_path, which was previously used in the CLI code for all calls to open a database.
2021-03-27lib/config: set default for primary user emailDavid Bremner
This is mainly copying code from the CLI into the lib. The CLI copy will be deleted in a later commit.
2021-03-27lib/config: set defaults for user full nameDavid Bremner
This just copies code from from the CLI into the library. New test infrastructure is needed because apparently we have never tested this code path.
2021-03-27lib/config: add config_pairs iteratorsDavid Bremner
The layer of shims here seems a bit wasteful compared to just calling the corresponding string map functions directly, but it allows control over the API (calling with notmuch_database_t *) and flexibility for future changes.
2021-03-27lib/config: add notmuch_config_get_values_stringDavid Bremner
This is to support the less common (at least in the notmuch codebase) case of accessing a ;-delimited list config value with an arbitrary string key.
2021-03-27lib: provide notmuch_database_load_configDavid Bremner
This is mainly targetted at notmuch-config.c, or similar applications that don't necessarily need both a configuration file and a database to exist.
2021-03-27lib/open: pull _load_key_file out of _choose_database_pathDavid Bremner
Although this increases code duplication, it also increases flexibility in handling various combinations of missing config file and missing database.
2021-03-27test: convert random-corpus to use n_d_open_with_configDavid Bremner
Remove one more usage of notmuch_config_get_database_path
2021-03-27lib: add missing status stringsDavid Bremner
2021-03-27lib/open: fix leaks calling _trial_openDavid Bremner
_trial_open can't know if the PATH_ERROR return value will cause the error message to be returned from the library, so it's up the caller to clean up if not.
2021-03-20CLI/new: use configuration variable for backup directoryDavid Bremner
The stat is essentially replaced by the mkdir for error detection purposes. This changes the default location for backups to make things tidier, even in non-split configurations. Hopefully there is not too many user scripts relying on the previous location. Because the default location may not exist, replace the use of stat for error detection with a call to mkdir.
2021-03-20lib/config: add configuration variable for backup directoryDavid Bremner
Like the hook directory, we primarily need a way to communicate this directory between various components, but we may as well let the user configure it. Most of the diff is generalizing choose_hook_dir to work for both backup and hook directories.
2021-03-20lib/open: fix hook directory calculation in split configurationDavid Bremner
Choose sibling directory of xapian database, as .notmuch may not exist. libgen.h is already used in debugger.c, so it is not a new dependency / potential portability problem.
2021-03-20lib/compact: enable split configDavid Bremner
This promotes _choose_xapian_path from static to extern linkage in order to share between open.cc and database.cc.
2021-03-20CLI/insert: support split database and mail rootDavid Bremner
The new test is in T055-path-config because it uses the helper function split_config, and because it seems easier to put the database path related tests in one place.
2021-03-20lib/open: support XDG_DATA_HOME as a fallback database location.David Bremner
This changes some error reporting, either intentionally by reporting the highest level missing directory, or by side effect from looking in XDG locations when given null database location.