v2 Index some attachements as text

2023-01-05 Thread David Bremner
This obsoletes the series starting with id:20220903232839.1473915-2-da...@tethera.net Compared to that series this is rebased against master, it has some more tests (including both positive and negative tests) and it documents the non-anchoredness of the involved regex search.

[PATCH v2 3/3] lib: index attachments with mime types matching index.as_text

2023-01-05 Thread David Bremner
Instead of skipping indexing all attachments, we check of a (user configured) mime type that is indexable as text. --- doc/man1/notmuch-config.rst| 10 lib/database.cc| 12 + lib/index.cc | 25 -- lib/notmuch-private.h

[PATCH v2 1/3] lib: add config key INDEX_AS_TEXT

2023-01-05 Thread David Bremner
Higher level processing as a list of regular expressions and documentation will follow. --- lib/config.cc| 3 +++ lib/notmuch.h| 1 + test/T030-config.sh | 1 + test/T055-path-config.sh | 1 + test/T590-libconfig.sh | 5 + 5 files changed, 11 insertions(+) diff

[PATCH v2 2/3] lib: parse index.as_text

2023-01-05 Thread David Bremner
We pre-parse into a list of compiled regular expressions to avoid calling regexc on the hot (indexing) path. As explained in the code comment, this cannot be done lazily with reasonable error reporting, at least not without touching a lot of the code in index.cc. --- lib/database-private.h | 4

Re: [PATCH 1/4] test: mark some tests as broken when run as root.

2023-01-05 Thread David Bremner
Tomi Ollila writes: > > Good progress -- bash has: > > $ bash -c 'set' | grep UID > EUID=1001 > UID=1001 I made that change. > another question is whether test_subtest_broken_for_root > is good name. perhaps it is tolerable enough I couldn't think of anything better, but am happy to search

Re: [PATCH 1/4] test: mark some tests as broken when run as root.

2023-01-05 Thread Tomi Ollila
On Wed, Jan 04 2023, David Bremner wrote: > File permission errors e.g., are hard to trigger as root. > --- > test/T050-new.sh | 1 + > test/T150-tagging.sh | 1 + > test/test-lib.sh | 6 ++ > 3 files changed, 8 insertions(+) > > diff --git a/test/T050-new.sh b/test/T050-new.sh >