notmuch-git

2022-05-15 Thread David Bremner
This series obsolates the WIP series at [1]. The rather long interdiff is given below [2]. At this point I think the tool is feature complete, at least enough for initial release. The main changes since the last series are the addition of configuration variables and a "safe_fraction" check that as

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

2022-05-15 Thread David Bremner
So far this is just a rename. Documentation and tests to follow. --- Makefile.local | 7 +-- devel/nmbug/nmbug => notmuch-git.in | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) rename devel/nmbug/nmbug => notmuch-git.in (99%) diff --git a/Makefile.local b/Makefi

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

2022-05-15 Thread David Bremner
This branch is actually only used by an associated utility (notmuch-report), and notmuch-git works fine without it. --- notmuch-git.in | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/notmuch-git.in b/notmuch-git.in index 4b94046d..57b5a0ec 100755 --- a/notmuch-git.in +++

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

2022-05-15 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 'tags/..

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

2022-05-15 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.in | 26 +

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

2022-05-15 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 02/17] CLI/git: drop support for python < 3.2

2022-05-15 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.in | 34 ++-

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

2022-05-15 Thread David Bremner
It is often more convenient to use command line arguments than environment variables. --- notmuch-git.in | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/notmuch-git.in b/notmuch-git.in index 5d6e29f0..4b94046d 100755 --- a/notmuch-git.in +++ b/

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

2022-05-15 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.in | 35 ++- test/T850-git.sh | 6 +++--- 2 files changed, 17 insert

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

2022-05-15 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 ++ doc/man

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

2022-05-15 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 HE

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

2022-05-15 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.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notmuch-git.in b/notmuch-git.in index f27591c9..78e4b140 100755 --- a/notmuch-git.

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

2022-05-15 Thread David Bremner
This is mainly derived from the various help outputs from the script, with some massaging of markup and addition of links. Define notmuch-git as a known external command. This will allow "notmuch help git" to invoke man notmuch-git, rather than erroring out. --- doc/conf.py | 4 +

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

2022-05-15 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 06/17] test: initial tests for notmuch-git

2022-05-15 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.in | 4 +++ test/T850-git.sh | 93 2 files changed, 97 insertions(+) create mode 100755 test/T850-git.

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

2022-05-15 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. --- doc/man1/notmuch-config.rst | 8 + doc/man1/notmuch-git.rst| 4 +++ notmuch-git.in | 6 ++-- test/T850-git.sh| 67

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

2022-05-15 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.in | 19 ++- 1 file changed, 18 inserti

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

2022-05-15 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 | 5 +- doc/Makefile.local |

Re: [PATCH] doc/emacs: document notmuch-show-toggle-toggle-elide-non-matching

2022-05-15 Thread David Bremner
David Bremner writes: > Recently there was a question on the mailing list about the existence > of this function, so let us try to make it more discoverable. applied to master. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send

[PATCH v2 0/1] notmuch-show-header-line: allow format strings and functions

2022-05-15 Thread jao
This one extends the previous version that accepted a format string by also accepting an arbitrary function. jao (1): emacs: notmuch-show-header-line: allow format strings and functions emacs/notmuch-show.el | 37 ++--- 1 file changed, 30 insertions(+), 7 deleti

[PATCH v2 1/1] emacs: notmuch-show-header-line: allow format strings and functions

2022-05-15 Thread jao
If a string value is assigned to notmuch-show-header-line, it's used as a format string to be passed passed to format-spec with `%s` substituted by the message's subject. If a function is given, it's called with the subject as argument, and its return value used as header line. As before, t means