[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: out of memory on idle machine

2021-02-07 Thread Gregor Zattler
Hi David, notmuch and xapian developers, * David Bremner [03. Feb. 2021]: > Gregor Zattler writes: >> >> Installed notmuch-dbgsym (0.28.4-1) and gdb. >> >> grfz@mic:/etc$ gdb --args notmuch new >> [...] >> (gdb) b notmuch-new.c:420 >> Breakpoint 1 at 0x10601: file notmuch-new.c, line 421. >>

Re: Please share recommendations of mail fetcher for notmuch on GNU

2021-02-07 Thread Jorge P . de Morais Neto
Hi. Thank you everyone for the recommendations! For now I decided to keep using OfflineIMAP on Python 2, but I took note of your isync recommendations and may switch to it in the near future. Regards Em [2021-01-16 sáb 13:00:48+0100], Alexander Adolf escreveu: > +1 for isync. I’m using it,