List archive

2021-02-28 Thread David Bremner
I have restarted the generation of a list archive at https://nmbug.notmuchmail.org/archive/notmuch-list.tar.xz As you can tell from the name, it's not an mbox anymore, but an archive of a Maildir. I have updated the links I found in the wiki. Let me know if I missed a link or if there are

Re: Notmuch email list subscription mechanism broken?

2021-02-27 Thread David Bremner
David Bremner writes: > > I hope Daniel, in copy, can figure out what is going on there. In the > mean time, hopefully you can use the email based unsubscription method > quoted just above. > > d I might have fixed it, purely by guesswork. Feel free to followup to the list if

Re: Notmuch email list subscription mechanism broken?

2021-02-27 Thread David Bremner
Mark Janes writes: > I was trying to adjust my mailing list subscriptions, and I found that > the unsubscribe mechanism for this list does not work: > > https://nmbug.notmuchmail.org/list/subunsub/unsubscribe > > returns > > internal server error > > -Mark >

Re: parallel test failures

2021-02-27 Thread David Bremner
Tomi Ollila writes: > So, AFAIU, you got 124 since timeout(1) exited with that status (and > killed all parallel(1) executions (after 2 minutes in that case?)... > ... and when you set NOTMUCH_TEST_TIMEOUT=0 then timeout(1) was not > executed and a test hung (probably T355-smime). That sounds

Re: parallel test failures

2021-02-26 Thread David Bremner
David Bremner writes: > Tomi Ollila writes: > >> >> Anyway, the log.gz did not show any tests failing but parallel exiting >> nonzero possibly for some other reason. Cannot say. Probably stracing (even >> with --seccomp-bpf) would make it happen even less likely :

Re: parallel test failures

2021-02-26 Thread David Bremner
Tomi Ollila writes: > > Anyway, the log.gz did not show any tests failing but parallel exiting > nonzero possibly for some other reason. Cannot say. Probably stracing (even > with --seccomp-bpf) would make it happen even less likely :/ > Thanks to both of you for your feedback / suggestions. I

[PATCH] test/emacs: test for functions in notmuch-search-result-format.

2021-02-22 Thread David Bremner
Based on the commit message in id:20210221151902.2301690-3-...@dme.org --- I didn't have time so far to write tests for the other two cases, but maybe this is a start. test/T310-emacs.sh| 27 +++ .../notmuch-search-header-function| 25

[PATCH v2 1/2] emacs: with-current-notmuch-show-message should return the result of body

2021-02-21 Thread David Edmondson
Rather than returning the result of kill-buffer, with-current-notmuch-show-message should return the result of calling the passed body. --- emacs/notmuch-show.el | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index

[PATCH v2 0/2] scaffolding for autocrypt support

2021-02-21 Thread David Edmondson
. I'll send autocrypt patches after some more testing and improvement. Currently things are pretty inefficient - autocrypt-notmuch-header will request the raw message on every call, which is expensive if the message is large. v2: - Rebased on master (bremner). David Edmondson (2): emacs

[PATCH v2 2/2] emacs: Add notmuch-show-insert-msg-hook

2021-02-21 Thread David Edmondson
Add a hook called after inserting each message into the buffer showing messages. --- emacs/notmuch-show.el | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 761be252..cda0bfe0 100644 --- a/emacs/notmuch-show.el +++

[PATCH v3 1/3] emacs: Use pcase in notmuch-search-insert-field

2021-02-21 Thread David Edmondson
Rather than lots of string-equal calls, use the pcase macro. --- emacs/notmuch.el | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 6d37c623..b9cee19c 100644 --- a/emacs/notmuch.el +++

[PATCH v3 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format

2021-02-21 Thread David Edmondson
If the car of an element in notmuch-tree-result-format or notmuch-unthreaded-result-format is a function, insert the result of calling the function into the buffer. --- emacs/notmuch-tree.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index

[PATCH v3 2/3] emacs: Allow functions in notmuch-search-result-format

2021-02-21 Thread David Edmondson
If the car of an element in notmuch-search-result-format is a function, insert the result of calling the function into the buffer. This allows a user to generate custom fields in the output of a search result. For example, with: (defun -notmuch-result-flags (format-string result) (let

[PATCH v3 0/3] Allow functions in notmuch-*-result-format

2021-02-21 Thread David Edmondson
As well as allowing headers to be specified in the various result format lists, allow functions that can be used to implement per-user logic when generating the results. v3: - Push the function test into the pcase (bremner). - Rebase to master (bremner). David Edmondson (3): emacs: Use pcase

[PATCH 07/18] lib/config: set defaults for user full name

2021-02-20 Thread David 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. --- lib/config.cc | 48 +- test/T590-libconfig.sh | 13 test/test-lib.sh | 7

[PATCH 05/18] WIP: add n_d_get_config_values

2021-02-20 Thread David Bremner
--- lib/config.cc | 14 ++ lib/notmuch.h | 2 ++ test/T590-libconfig.sh | 23 +++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lib/config.cc b/lib/config.cc index 32ed6f8f..47e8bf82 100644 --- a/lib/config.cc +++

[PATCH 06/18] lib/config: add config_pairs iterators

2021-02-20 Thread David 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. --- lib/config.cc | 39 ++

[PATCH 17/18] CLI/config: drop cached data from notmuch_config_t

2021-02-20 Thread David Bremner
The idea is to preserve notmuch_config_t as a thin wrapper for GKeyFile. --- notmuch-config.c | 48 +--- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 1382b0a3..0b2976f4 100644 ---

[PATCH 04/18] WIP: add notmuch_database_load_config

2021-02-20 Thread David Bremner
This needs at least documentation and probably more tests. --- lib/notmuch.h | 9 ++ lib/open.cc| 96 ++ test/T590-libconfig.sh | 182 - 3 files changed, 284 insertions(+), 3 deletions(-) diff --git

[PATCH 16/18] cli/config: drop obsolete notmuch_config_get_*

2021-02-20 Thread David Bremner
These are no longer used, replaced by notmuch_config_get. --- notmuch-client.h | 29 notmuch-config.c | 119 --- 2 files changed, 148 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index dfdfc876..677f2f39 100644 ---

[PATCH 09/18] CLI/notmuch: replace use of notmuch_config_get_*

2021-02-20 Thread David Bremner
The notmuch_config_get_{field_name} internal API will be removed in a subsequent commit. --- notmuch.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notmuch.c b/notmuch.c index 71482e43..a161f127 100644 --- a/notmuch.c +++ b/notmuch.c @@ -364,7 +364,7 @@

[PATCH 03/18] lib/open: pull _load_key_file out of _choose_database_path

2021-02-20 Thread David Bremner
Although this increases code duplication, it also increases flexibility in handling various combinations of missing config file and missing database. --- lib/open.cc | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/open.cc

[PATCH 18/18] WIP: CLI/config: make storing configuration in database optional

2021-02-20 Thread David Bremner
Originally I planned to drop this functionality, but it is useful e.g. for our test suite to be able to set config keys in the database without using notmuch-restore. New option needs documentation --- notmuch-config.c | 26 ++ test/T030-config.sh| 19

[PATCH 02/18] test: convert random-corpus to use n_d_open_with_config

2021-02-20 Thread David Bremner
Remove one more usage of notmuch_config_get_database_path --- test/random-corpus.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/random-corpus.c b/test/random-corpus.c index ff413252..67e106e0 100644 --- a/test/random-corpus.c +++ b/test/random-corpus.c @@

[PATCH 14/18] CLI/config: migrate notmuch_config_open to new config

2021-02-20 Thread David 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) --- lib/config.cc | 5 +- notmuch-client.h | 2 +- notmuch-config.c | 157 +

[PATCH 12/18] WIP: switch notmuch-setup to new configuration framework

2021-02-20 Thread David Bremner
--- notmuch-setup.c | 55 +++-- notmuch.c | 19 ++--- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/notmuch-setup.c b/notmuch-setup.c index 67214470..1e22412b 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@

[PATCH 01/18] lib: add missing status strings

2021-02-20 Thread David Bremner
--- lib/database.cc | 8 1 file changed, 8 insertions(+) diff --git a/lib/database.cc b/lib/database.cc index ffd42ac4..87ad1385 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -292,12 +292,20 @@ notmuch_status_to_string (notmuch_status_t status) return "Operation requires

[PATCH 11/18] WIP: CLI/config: use merged config for "config get"

2021-02-20 Thread David Bremner
--- notmuch-config.c| 92 + test/T030-config.sh | 20 +- 2 files changed, 28 insertions(+), 84 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 0193401f..a4613227 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@

[PATCH 10/18] CLI/config: WIP: load merged config

2021-02-20 Thread David Bremner
--- notmuch-client.h | 1 + notmuch.c | 29 ++--- test/T030-config.sh| 11 +++ test/T590-libconfig.sh | 3 --- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index f60f5406..db88daf8

[PATCH 13/18] WIP: CLI/config: switch list to new config

2021-02-20 Thread David Bremner
Test output changes because keys are now listed in alphabetical order, and because a missing database is no longer an error. --- notmuch-config.c| 69 - test/T030-config.sh | 27 -- test/T040-setup.sh | 27 +++--- 3

[PATCH 15/18] WIP: cli/config: convert to new config API

2021-02-20 Thread David Bremner
--- notmuch-config.c | 16 +++- test/T750-user-header.sh | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 3d0959fb..390998b1 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -725,9 +725,8 @@

[PATCH 08/18] lib/config: set default for primary user email

2021-02-20 Thread David Bremner
This is mainly copying code from the CLI into the lib. The CLI copy will be deleted in a later commit. --- lib/config.cc | 70 +++--- test/T590-libconfig.sh | 4 +-- test/test-lib.sh | 6 +++- 3 files changed, 73 insertions(+), 7 deletions(-)

RFC convert remaining CLI to new configuration

2021-02-20 Thread David Bremner
This is an early version of a series to convert the remaining CLI (config, setup, and notmuch_command) to the new configuration framework. There are a few design decisions / compromomises that people might have opinions about. - The merged config API uses a notmuch_data_t as the primary

parallel test failures

2021-02-19 Thread David Bremner
I have intermittent failures when running the test suite on sufficiently parallel machines. I have attached a log of such a failing build, although it does not seem especially illuminating. It takes anywhere from 5 to 300 runs to get a failure for me running on 60 hardware threads (30 cores).

notmuch release 0.31.4 now available

2021-02-18 Thread David Bremner
://notmuchmail.org/releases/notmuch-0.31.4.tar.xz.asc (signed by David Bremner) What's new in notmuch 0.31.4 = Library --- Fix include bug triggered by glib 2.67. Test Fix race condition in T568-lib-thread. What is notmuch === Notmuch is a system

[PATCH 12/21] lib/open: Use check for existing database by trial opening

2021-02-17 Thread David Bremner
This is a bit heavyweight for now, but it will make more sense when we check multiple locations for the xapian database. --- lib/open.cc| 67 +++--- test/T360-symbol-hiding.sh | 2 +- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git

[PATCH 10/21] lib/open: factor out the second half of n_d_open_with_config

2021-02-17 Thread David Bremner
The idea is to allow reuse in n_d_create_with_config. This is primarily code movement, with some changes in error messages to reduce the number of input parameters. --- lib/open.cc | 115 +++- 1 file changed, 68 insertions(+), 47 deletions(-) diff

[PATCH 15/21] CLI/new: support split database and mail location

2021-02-17 Thread David Bremner
This adds new state variable for the mail root, and uses it most places db_path was used. The notable exception is dumps from backups. --- notmuch-new.c| 54 ++-- test/T055-path-config.sh | 41 ++ 2 files changed, 76

[PATCH 21/21] CLI/new: use configuration variable for backup directory

2021-02-17 Thread David Bremner
The stat is dropped to avoid a race condition between stat and mkdir. This changes the default location for backups to make things tidier. Hopefully there is not user scripts relying on this location. --- notmuch-new.c| 18 ++ test/T055-path-config.sh | 15

[PATCH 13/21] support splitting mail from database location.

2021-02-17 Thread David Bremner
Introduce a new configuration value for the mail root, and use it in preference to the database.path (which previously implied the mail was also in this location. Further changes to the CLI will be needed to work in this split configuration. --- doc/man1/notmuch-config.rst | 14 --

[PATCH 17/21] CLI/insert: support split database and mail root

2021-02-17 Thread David Bremner
The new test is in T055-path-config because it uses the helper function split_config, and because it seems easier to follow the database path related tests in one place. --- notmuch-insert.c | 12 +++- test/T055-path-config.sh | 10 ++ 2 files changed, 13 insertions(+), 9

[PATCH 02/21] lib: save path of xapian database in notmuch struct.

2021-02-17 Thread David Bremner
This will allow re-opening in a different mode (read/write vs. read-only) with current Xapian API. --- lib/database-private.h | 4 lib/open.cc| 19 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/database-private.h b/lib/database-private.h

[PATCH 18/21] lib/compact: enable split config

2021-02-17 Thread David Bremner
This promotes _choose_xapian_path from static to extern linkage in order to share between open.cc and database.cc. --- lib/database.cc | 13 - lib/notmuch-private.h| 4 lib/open.cc | 6 +++--- test/T055-path-config.sh | 7 +++ 4 files changed, 18

[PATCH 19/21] lib/open: fix hook directory calculation in split configuration

2021-02-17 Thread David Bremner
Choose sibling directory of xapian database, as .notmuch may not exist. --- lib/open.cc| 6 -- test/T400-hooks.sh | 9 - 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index 1e2a62cd..4324deae 100644 --- a/lib/open.cc +++

[PATCH 03/21] lib: support reopening databases for write access.

2021-02-17 Thread David Bremner
In the future xapian will apparently support this more conveniently for the cases other than READ_ONLY => READ_ONLY --- lib/database.cc | 23 lib/notmuch.h | 6 +++ lib/open.cc | 45 test/T595-reopen.sh | 125

[PATCH 14/21] lib/open: check for split configuration when creating database.

2021-02-17 Thread David Bremner
This will be tested when notmuch-new is converted to support split configuration. --- lib/open.cc | 53 ++-- test/T055-path-config.sh | 15 ++-- 2 files changed, 53 insertions(+), 15 deletions(-) diff --git a/lib/open.cc b/lib/open.cc

[PATCH 05/21] lib/open: support NOTMUCH_DATABASE environment variable

2021-02-17 Thread David Bremner
The additional code is trivial, but making sure we get the priority of various options correct takes a few tests. --- lib/open.cc| 4 +++ test/T590-libconfig.sh | 67 +- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/lib/open.cc

[PATCH 06/21] lib/open: allocate notmuch_t struct early

2021-02-17 Thread David Bremner
This gives more flexibility in restructuring the database opening code. --- lib/open.cc | 46 +- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index f08b5de5..c7fb6f81 100644 --- a/lib/open.cc +++

[PATCH 09/21] lib/open: reuse directory checks from n_d_c_with_config

2021-02-17 Thread David Bremner
Make checks more uniform between creating new databases and opening existing ones. --- lib/open.cc | 73 +--- test/T030-config.sh | 2 +- test/T560-lib-error.sh | 4 +-- test/T750-user-header.sh | 2 +- 4 files changed, 50 insertions(+),

[PATCH 04/21] CLI/show: complete conversion to new configuration framework.

2021-02-17 Thread David Bremner
In order to open the database in main() for this command, we may need to re-open it in the (possibly less common) case where crypto options require it. --- notmuch-show.c | 26 +++--- notmuch.c| 2 +- test/T035-read-config.sh | 2 -- 3 files

[PATCH 07/21] lib: remove "path" from notmuch struct

2021-02-17 Thread David Bremner
This removes duplication between the struct element and the configuration string_map entry. --- lib/config.cc | 3 +++ lib/database-private.h | 3 --- lib/database.cc| 2 +- lib/open.cc| 13 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff

[PATCH 11/21] lib/open: use _finish_open in n_d_create_with_config

2021-02-17 Thread David Bremner
This avoids reading the configuration file twice. --- lib/open.cc | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index d052f95d..ebf70c15 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -429,8 +429,7 @@

[PATCH 16/21] lib/open: support XDG_DATA_HOME as a fallback database location.

2021-02-17 Thread 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. --- lib/open.cc | 18 +++--- test/T055-path-config.sh | 35

[PATCH 01/21] lib: publish API for notmuch_database_reopen

2021-02-17 Thread David Bremner
Include the (currently unused) mode argument which will specify which mode to re-open the database in. Functionality and docs to be finalized in a followup commit. --- lib/database.cc | 3 ++- lib/message.cc| 3 ++- lib/notmuch-private.h | 3 --- lib/notmuch.h | 7 +++ 4

v2 flexible database location

2021-02-17 Thread David Bremner
This is series 2 of 3 revamping configuration. It obsoletes [1]. The first 4 patches are really unfinished business from the the first series already merged to master. They bring merged configuration (no more "Defined in Database") to notmuch-show (leaving only notmuch-config and notmuch-setup

[PATCH 20/21] lib/config: add configuration variable for backup directory

2021-02-17 Thread David 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. --- lib/config.cc | 3 +++ lib/notmuch.h | 1 + lib/open.cc| 47 --

[PATCH 08/21] lib/open: factor out library initialization

2021-02-17 Thread David Bremner
This is slightly more tidy, but more importantly it allows for re-use of this code in n_d_create_with_config. --- lib/open.cc | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index d599aeac..7f25bd36 100644 ---

Re: [PATCH 2/2] emacs: Add notmuch-show-insert-msg-hook

2021-02-15 Thread David Bremner
David Edmondson writes: > Add a hook called after inserting each message into the buffer showing > messages. first patch is fine, second no longer applies. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to n

[PATCH 2/2] lib: use a stricter unused macro

2021-02-14 Thread David Bremner
This would have caught bugs like the one corrected in the previous commit. --- lib/notmuch-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 2fbf7ab9..2f5ccd6a 100644 --- a/lib/notmuch-private.h +++

[PATCH 1/2] lib/open: remove incorrect unused attribute

2021-02-14 Thread David Bremner
With the current unused macro in lib/notmuch-private.h this seems harmless, but is misleading, since the parameter is in fact used. --- lib/open.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open.cc b/lib/open.cc index b4637ec5..3b86065b 100644 --- a/lib/open.cc +++

[PATCH] test: Fix race condition in T568-lib-thread.sh

2021-02-14 Thread David Bremner
The assignment of thread-ids is (apparently) non-deterministic in a way that mostly seems to show up on multicore machines. In my tests the number is different from that previously assumed by this test about 15% of the time on a 50 thread (25 core) Xeon. Since message id's are fixed, use a

Re: [PATCH] fix FTBFS with glib

2021-02-12 Thread David Bremner
Michael J Gruber writes: > With newer glib, notmuch FTBFS because of C linkage error. This is due > to a misplaced include (inside an extern "C") which was always there > but exposed only recently through this change in glib: > > https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715 > > Move

Re: Break thread relationship

2021-02-12 Thread David Bremner
Ico Doornekamp writes: > > I tried to remove the "References" and "In-Reply-To" headers of the > offending mail, and reindex the thread. This seems not enough to > convince notmuch that these mails are no longer related, because the > original and separated thread still end up with the same

Re: out of memory on idle machine

2021-02-11 Thread David Bremner
Gregor Zattler writes: > Hi David, notmuch and xapian developers, > * David Bremner [03. Feb. 2021]: > > >> Olly Betts mentioned in a different thread that he will build a version >> of xapian 1.4.18 for buster backports, so trying with that is probably a >>

Re: Tagging in tree mode

2021-02-08 Thread David Bremner
I get "Nothing to tag!" instead of the expected behaviour. I'm pretty sure that "d" in show mode is something you have customized. david ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

[PATCH 05/23] lib/open: support NOTMUCH_DATABASE environment variable

2021-02-07 Thread David Bremner
The additional code is trivial, but making sure we get the priority of various options correct takes a few tests. --- lib/open.cc| 4 +++ test/T590-libconfig.sh | 67 +- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/lib/open.cc

[PATCH 15/23] CLI/new: support split database and mail location

2021-02-07 Thread David Bremner
This adds new state variable for the mail root, and uses it most places db_path was used. The notable exception is dumps from backups. --- notmuch-new.c| 54 ++-- test/T055-path-config.sh | 13 ++ 2 files changed, 48 insertions(+), 19

[PATCH 14/23] lib/open: support XDG_DATA_HOME as a fallback database location.

2021-02-07 Thread 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. --- lib/open.cc | 60 test/T055-path-config.sh | 34

[PATCH 21/23] CLI/address: tests for split config

2021-02-07 Thread David Bremner
output=recipients requires access to raw mail files. --- test/T055-path-config.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index d0019cd1..13086e50 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@

[PATCH 20/23] CLI/reply: tests for split config

2021-02-07 Thread David Bremner
Citing the original message requires access to the mail files. --- test/T055-path-config.sh | 19 +++ 1 file changed, 19 insertions(+) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 7bd9739b..d0019cd1 100755 --- a/test/T055-path-config.sh +++

[PATCH 17/23] lib: remove "path" from notmuch struct

2021-02-07 Thread David Bremner
This removes duplication between the struct element and the configuration string_map entry. --- lib/config.cc | 3 +++ lib/database-private.h | 3 --- lib/database.cc| 2 +- lib/open.cc| 22 +++--- 4 files changed, 19 insertions(+), 11 deletions(-)

[PATCH 02/23] lib: save path of xapian database in notmuch struct.

2021-02-07 Thread David Bremner
This will allow re-opening in a different mode (read/write vs. read-only) with current Xapian API. --- lib/database-private.h | 4 lib/open.cc| 19 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/database-private.h b/lib/database-private.h

[PATCH 16/23] CLI/insert: support split database and mail root

2021-02-07 Thread David Bremner
The new test is in T055-path-config because it uses the helper function split_config, and because it seems easier to follow the database path related tests in one place. --- notmuch-insert.c | 12 +++- test/T055-path-config.sh | 10 ++ 2 files changed, 13 insertions(+), 9

[PATCH 07/23] support splitting mail from database location.

2021-02-07 Thread David Bremner
Introduce a new configuration value for the mail root, and use it in preference to the database.path (which previously implied the mail was also in this location. Multiple changes to the CLI and third party clients will be needed to work in this split configuration. ---

[PATCH 18/23] CLI/show: add tests for raw output in split config

2021-02-07 Thread David Bremner
This is a case where the CLI accesses both the database and the raw mail file --- test/T055-path-config.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 1bae1b1b..e5036400 100755 --- a/test/T055-path-config.sh +++

[PATCH 08/23] support splitting mail from database location.

2021-02-07 Thread David Bremner
Introduce a new configuration value for the mail root, and use it in preference to the database.path (which previously implied the mail was also in this location. Multiple changes to the CLI and third party clients will be needed to work in this split configuration. --- test/T055-path-config.sh

[PATCH 01/23] lib: publish API for notmuch_database_reopen

2021-02-07 Thread David Bremner
Include the (currently unused) mode argument which will specify which mode to re-open the database in. Functionality and docs to be finalized in a followup commit. --- lib/database.cc | 3 ++- lib/message.cc| 3 ++- lib/notmuch-private.h | 3 --- lib/notmuch.h | 7 +++ 4

[PATCH 12/23] lib/open: reuse directory checks from n_d_c_with_config

2021-02-07 Thread David Bremner
Make checks more uniform between creating new databases and opening existing ones. --- lib/open.cc| 50 +++--- test/T560-lib-error.sh | 4 ++-- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index

[PATCH 10/23] lib/open: factor out the second half of n_d_open_with_config

2021-02-07 Thread David Bremner
The idea is to allow reuse in n_d_create_with_config. This is primarily code movement, with some changes in error messages to reduce the number of input parameters. --- lib/open.cc | 118 +--- 1 file changed, 67 insertions(+), 51 deletions(-) diff

[PATCH 13/23] lib/open: open existing databases without .notmuch in path

2021-02-07 Thread David Bremner
In a split configuration, it does not make sense to have the extra .notmuch/ directory. Leave the xapian/ level of the path to allow the use of the top level e.g. as a place to store backups as is currently done by upgrade code in notmuch-new. --- lib/open.cc| 71

[PATCH 23/23] test: add test for reindex in split configurations

2021-02-07 Thread David Bremner
--- test/T055-path-config.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 5251aebf..44572695 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -166,6 +166,12 @@ EOF notmuch dump > OUTPUT

[PATCH 04/23] CLI/show: complete conversion to new configuration framework.

2021-02-07 Thread David Bremner
In order to open the database in main() for this command, we may need to re-open it in the (possibly less common) case where crypto options require it. --- notmuch-show.c | 26 +++--- notmuch.c| 2 +- test/T035-read-config.sh | 2 -- 3 files

[PATCH 22/23] test: add tests for dump and restore in split configuration

2021-02-07 Thread David Bremner
--- test/T055-path-config.sh | 16 1 file changed, 16 insertions(+) diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 13086e50..5251aebf 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -150,6 +150,22 @@ notmuch@notmuchmail.org EOF

[PATCH 06/23] lib/open: allocate notmuch_t struct early

2021-02-07 Thread David Bremner
This gives more flexibility in restructuring the database opening code. --- lib/open.cc | 46 +- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index c200bed6..09fec6e4 100644 --- a/lib/open.cc +++

[PATCH 03/23] lib: support reopening databases for write access.

2021-02-07 Thread David Bremner
In the future xapian will apparently support this more conveniently for the cases other than READ_ONLY => READ_ONLY --- lib/database.cc | 23 lib/open.cc | 40 ++ test/T595-reopen.sh | 125 3 files changed, 165

[PATCH 09/23] lib/open: factor out library intialization

2021-02-07 Thread David Bremner
This is slightly more tidy, but more importantly it allows for re-use of this code in n_d_create_with_config --- lib/open.cc | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index 09fec6e4..ff298030 100644 ---

[PATCH 11/23] lib/open: use _finish_open in n_d_create_with_config

2021-02-07 Thread David Bremner
This avoids reading the configuration file twice. --- lib/open.cc | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/open.cc b/lib/open.cc index 74fac37d..f4690763 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -459,14 +459,25 @@

Support flexible database location

2021-02-07 Thread David Bremner
This series obsoletes and includes the series at [1]. It adds support for configuring a seperate location for the mail files and the xapian database. XDG compliant locations for the database are supported. The notmuch-config and notmuch-setup commands still needed to be updated to handle the new

[PATCH 19/23] lib/compact: enable split config

2021-02-07 Thread David Bremner
This promotes _choose_xapian_path from static to extern linkage in order to share between open.cc and database.cc. --- lib/database.cc | 13 - lib/notmuch-private.h| 4 lib/open.cc | 6 +++--- test/T055-path-config.sh | 6 ++ 4 files changed, 17

Re: v5 merged config

2021-02-06 Thread David Bremner
David Bremner writes: > The main difference since Tomi's review is that I made several more > tests for configuration path searching in T035-read-config.sh, and > moved some of the existing ones there. I have applied this series (1-39, with the one updated patch) to master. That's

[PATCH 2/4] lib: save path of xapian database in notmuch struct.

2021-02-06 Thread David Bremner
This will allow re-opening in a different mode (read/write vs. read-only) with current Xapian API. --- lib/database-private.h | 4 lib/open.cc| 19 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/database-private.h b/lib/database-private.h

[PATCH 3/4] lib: support reopening databases for write access.

2021-02-06 Thread David Bremner
In the future xapian will apparently support this more conveniently for the cases other than READ_ONLY => READ_ONLY --- lib/database.cc | 23 lib/open.cc | 40 ++ test/T595-reopen.sh | 125 3 files changed, 165

[PATCH 1/4] lib: publish API for notmuch_database_reopen

2021-02-06 Thread David Bremner
Include the (currently unused) mode argument which will specify which mode to re-open the database in. Functionality and docs to be finalized in a followup commit. --- lib/database.cc | 3 ++- lib/message.cc| 3 ++- lib/notmuch-private.h | 3 --- lib/notmuch.h | 7 +++ 4

[PATCH 4/4] CLI/show: complete conversion to new configuration framework.

2021-02-06 Thread David Bremner
In order to open the database in main() for this command, we may need to re-open it in the (possibly less common) case where crypto options require it. --- notmuch-show.c | 26 +++--- notmuch.c| 2 +- test/T035-read-config.sh | 2 -- 3 files

Complete conversion of notmuch-show to new config framework

2021-02-06 Thread David Bremner
The series at id:20210205132654.3258292-1-da...@tethera.net only partially converted notmuch-show to the new merged configuration style. This meant in particular that finding configuration files via XDG conventions did not work for notmuch-show. As a side effect, publish notmuch_database_reopen

[PATCH] CLI/show: mostly switch show to new config framework

2021-02-06 Thread David Bremner
This will need some cleanup when the transition completes, and we stop passing notmuch_config_t structs to the subcommands. Unlike the general case, we open the database in the subcommand, since we don't know whether it should be opened read/write until we parse the command line arguments. Add a

Re: [PATCH] notmuch-show: use correct format specifier for ssize_t

2021-02-05 Thread David Bremner
Đoàn Trần Công Danh writes: > Signed-off-by: Đoàn Trần Công Danh applied to master d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: [PATCH v2] emacs: When completing tags, offer each tag once

2021-02-05 Thread David Bremner
David Edmondson writes: > When prompting for one or more tags to add or remove to/from one or > more threads, ensure that the set of tags offered for completion > contains no duplicates. applied to master d ___ notmuch mailing list -

[PATCH 10/39] lib/config: add config values iterator

2021-02-05 Thread David Bremner
This is intended to avoid duplicating the string splitting and traversal code for all clients of the config API. --- lib/config.cc | 52 ++ lib/notmuch.h | 64 ++ notmuch.c | 35

[PATCH 09/39] util: add strsplit_len: simplified strtok with delimiter escaping

2021-02-05 Thread David Bremner
This will be used to make iterators for configuration values. --- util/string-util.c | 23 +++ util/string-util.h | 14 ++ 2 files changed, 37 insertions(+) diff --git a/util/string-util.c b/util/string-util.c index de8430b2..27f8a26b 100644 ---

  1   2   3   4   5   6   7   8   9   10   >