[PATCH 3/4] lib/sexp: allow * as alias for "" in range searches.

2022-06-04 Thread David Bremner
It can be tedious to use "" inside of a string, e.g. in a shell script. --- lib/parse-sexp.cc | 5 + test/T081-sexpr-search.sh | 20 2 files changed, 25 insertions(+) diff --git a/lib/parse-sexp.cc b/lib/parse-sexp.cc index 6282a456..6814c9fc 100644 ---

[PATCH 2/4] lib/sexp: special case "" as an argument in lastmod ranges.

2022-06-04 Thread David Bremner
Support this syntax for constincy with (data from to) ranges. --- lib/parse-sexp.cc | 10 -- test/T081-sexpr-search.sh | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/parse-sexp.cc b/lib/parse-sexp.cc index 08fd7037..6282a456 100644 ---

[PATCH 4/4] doc/sexp: document range queries.

2022-06-04 Thread David Bremner
Give examples for date fields, as these are commonly useful for user queries. --- doc/man7/notmuch-sexp-queries.rst | 18 ++ 1 file changed, 18 insertions(+) diff --git a/doc/man7/notmuch-sexp-queries.rst b/doc/man7/notmuch-sexp-queries.rst index 1d7e0ae9..be589f98 100644 ---

[PATCH 1/4] test/sexp: one sided range searches.

2022-06-04 Thread David Bremner
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. --- test/T081-sexpr-search.sh | 22 ++ 1 file changed, 22 insertions(+) diff --git

[PATCH v2] emacs: use message-dont-reply-to-names when composing replies

2022-06-04 Thread jao
notmuch-mua functions for replies now use the built-in customizable variable message-dont-reply-to-names with the same semantics as message-mode. --- This version of the patch adds more testing and ensures predicate values work Signed-off-by: jao --- doc/notmuch-emacs.rst | 9

[PATCH] emacs: use message-dont-reply-to-names when composing replies

2022-06-04 Thread jao
notmuch-mua functions for replies now use the built-in customizable variable message-dont-reply-to-names with the same semantics as message-mode. Signed-off-by: jao --- doc/notmuch-emacs.rst | 9 emacs/notmuch-mua.el| 13

[no subject]

2022-06-04 Thread David Bremner
This series is against branch "next", which is currently ahead of master by the following 7 commits 9c1ed5ab CLI: document handling of --config for external commands 0d33392f CLI: pass --config to external commands via NOTMUCH_CONFIG. 163dae81 test: initial tests for external commands a5a3ed90

[PATCH v3 13/17] doc/notmuch-git: initial documentation

2022-06-04 Thread David Bremner
This is mainly derived from the various help outputs from the script, with some massaging of markup and addition of links. --- doc/conf.py | 4 + doc/index.rst| 1 + doc/man1/notmuch-git.rst | 271 +++ 3 files changed, 276

[PATCH v3 17/17] debian: install notmuch-git

2022-06-04 Thread David Bremner
Use a separate binary package to avoid dragging in dependencies on python and git for those that do not want them. --- debian/control | 16 debian/notmuch-git.install | 2 ++ debian/notmuch-git.manpages | 2 ++ 3 files changed, 20 insertions(+) create mode 100644

[PATCH v3 09/17] test/git: add known broken test for tag with quotes.

2022-06-04 Thread David Bremner
There is current insufficient sanitization and/or escaping of tag names internally in notmuch-git. --- test/T850-git.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/test/T850-git.sh b/test/T850-git.sh index 994950ed..2badc52d 100755 --- a/test/T850-git.sh +++ b/test/T850-git.sh

[PATCH v3 06/17] test: initial tests for notmuch-git

2022-06-04 Thread David Bremner
Exercise the main functionality of notmuch-git. add_git_repos() will hopefully be simplifed when an init subcommand is added. --- notmuch-git.py | 4 +++ test/T850-git.sh | 93 2 files changed, 97 insertions(+) create mode 100755

[PATCH v3 03/17] notmuch-git: add --git-dir, --tag-prefix arguments

2022-06-04 Thread David Bremner
It is often more convenient to use command line arguments than environment variables. --- notmuch-git.py | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/notmuch-git.py b/notmuch-git.py index fb42e5bf..34d07125 100644 --- a/notmuch-git.py +++

[PATCH v3 12/17] CLI/git: cache git indices

2022-06-04 Thread David Bremner
If the private index file matches a previously known revision of the database, we can update the index incrementally using the recorded lastmod counter. This is typically much faster than a full update, although it could be slower in the case of large changes to the database. The "git-read-tree

[PATCH v3 16/17] CLI/git: add safety checks for checkout and commit

2022-06-04 Thread David Bremner
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. --- doc/man1/notmuch-config.rst | 7

[PATCH v3 02/17] CLI/git: drop support for python < 3.2

2022-06-04 Thread David Bremner
Debian stable had python 3.4.2 3 releases ago (approximately 6 years ago), so attempting to keep track of the changes in python is probably no longer worthwhile. We already require python 3.5 for the python-cffi bindings (although those are not yet used in notmuch-git). --- notmuch-git.py | 33

[PATCH v3 15/17] CLI/git: support configuration for repo location / prefix

2022-06-04 Thread David Bremner
This is probably more convenient than always passing a command line argument. Use notmuch-config for consistency with other notmuch CLI tools. Now that there is something relevant in the config files, test the --config option. --- doc/man1/notmuch-config.rst | 8 doc/man1/notmuch-git.rst

[PATCH v3 01/17] nmbug: promote to user tool "notmuch-git"

2022-06-04 Thread David Bremner
Initially just a rename, and drop the --version argument that clashes with the global notmuch --version argument. --- Makefile.local | 7 ++- devel/nmbug/nmbug => notmuch-git.py | 6 -- 2 files changed, 6 insertions(+), 7 deletions(-) rename devel/nmbug/nmbug =>

[PATCH v3 05/17] CLI/git: Add an 'init' command

2022-06-04 Thread David Bremner
From: "W. Trevor King" For folks that want to start versioning a new tag-space, instead of cloning one that someone else has already started. The empty-blob hash-object call avoids errors like: $ nmbug commit error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for

[PATCH v3 04/17] CLI/git: make existance of config branch optional on clone

2022-06-04 Thread David Bremner
This branch is actually only used by an associated utility (notmuch-report), and notmuch-git works fine without it. --- notmuch-git.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/notmuch-git.py b/notmuch-git.py index 34d07125..0cbfec61 100644 --- a/notmuch-git.py

[PATCH v3 10/17] CLI/git: replace enumeration of tags with sexp query.

2022-06-04 Thread David Bremner
Unlike the (current) infix query parser provided by Xapian, the notmuch specific sexp query parser supports prefixed wildcard queries, so use those. In addition to being somewhat faster, this avoids needing to escape all of the user's tags to pass via the shell. --- notmuch-git.py | 26

[PATCH v3 14/17] CLI/git: change defaults for repo and prefix

2022-06-04 Thread David Bremner
The previous defaults were not suitable for personal (i.e. not bugtracking for notmuch development) use. Provide two ways for the user to select nmbug compatible defaults; command line argument and checking the name of the script. --- Makefile.local | 6 ++- doc/Makefile.local

[PATCH v3 11/17] CLI/git: add @timed decorator, time a few functions

2022-06-04 Thread David Bremner
Perf will show which binaries are using the CPU cycles, and standard python profilers will show which python functions, but neither is great at finding which call to an external binary is taking time, or locating I/O hotspots. --- notmuch-git.py | 19 ++- 1 file changed, 18

[PATCH v3 08/17] CLI/git: suppress warnings about initial branch name

2022-06-04 Thread David Bremner
The canonical nmbug repository still uses "master" as the main branch name, so defer any potential switch away from that name. --- notmuch-git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notmuch-git.py b/notmuch-git.py index f3ad6927..543ef4f1 100644 ---

[PATCH v3 07/17] CLI/git: rename environment variables.

2022-06-04 Thread David Bremner
Although the code required to support both new and old environment variables is small, it complicates the semantics of configuration, and make the documentation harder to follow. --- notmuch-git.py | 35 ++- test/T850-git.sh | 6 +++--- 2 files changed, 17

[PATCH v2] CLI: set NOTMUCH_CONFIG in hooks.

2022-06-04 Thread David Bremner
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). [1]: id:8baa58c3-7ab9-ec03-1bbd-28aa5be83...@kleine-koenig.org --- hooks.c