Re: v2 fix leaks in n_d_open_with_config

2022-01-22 Thread David Bremner
Austin Ray  writes:

> I can confirm this fixes the leak on my end. Thanks!
>
>> I'm slightly worried that ASAN tests will prove to be flaky.
>
> If I recall correctly, the Chromium project runs ASAN in their CI
> pipelines and it's pretty stable. Hopefully that's some evidence towards
> their stability.

Series applied to master. I guess we'll just have to see about the ASAN
tests. It would be nice to have more memory checking in the test suite
if it works out.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: v2 fix leaks in n_d_open_with_config

2022-01-22 Thread Austin Ray
I can confirm this fixes the leak on my end. Thanks!

> I'm slightly worried that ASAN tests will prove to be flaky.

If I recall correctly, the Chromium project runs ASAN in their CI
pipelines and it's pretty stable. Hopefully that's some evidence towards
their stability.

Austin

-- 
https://austinray.io
Open Source Maintainer, Software Engineer, Keyboard Enthusiast
GPG: 0127 ED83 B939 CCC9 8082 476E 1AA0 B115 C8AC 2C9E


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 1/2] Revert "emacs: use --exclude=false when checking for empty searches"

2022-01-22 Thread David Bremner
Revert commit 8370e3cfe2dd8a79323613c2bbf2f11db6134dac, and remark the
corresponding test as broken. Also update the expected output of the
broken test to show excludes active in the user defined saved searches.
---
 emacs/notmuch-hello.el| 2 +-
 test/T440-emacs-hello.sh  | 1 +
 test/emacs.expected-output/notmuch-hello-all-tags | 4 
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 9ac52c11..71e91093 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -570,7 +570,7 @@ options will be handled as specified for
(plist-get options :filter
 "\n")))
 (unless (= (notmuch--call-process-region (point-min) (point-max) 
notmuch-command
-t t nil "count" "--exclude=false" 
"--batch") 0)
+   t t nil "count" "--batch") 0)
   (notmuch-logged-error
"notmuch count --batch failed"
"Please check that the notmuch CLI is new enough to support `count
diff --git a/test/T440-emacs-hello.sh b/test/T440-emacs-hello.sh
index 842781a4..dc80cc75 100755
--- a/test/T440-emacs-hello.sh
+++ b/test/T440-emacs-hello.sh
@@ -69,6 +69,7 @@ notmuch tag -$tag '*'
 test_expect_equal_file $EXPECTED/notmuch-hello-long-names OUTPUT
 
 test_begin_subtest "All tags show up"
+test_subtest_known_broken
 tag=exclude_me
 notmuch tag +$tag '*'
 notmuch config set search.exclude_tags $tag
diff --git a/test/emacs.expected-output/notmuch-hello-all-tags 
b/test/emacs.expected-output/notmuch-hello-all-tags
index 2802a708..65e479fa 100644
--- a/test/emacs.expected-output/notmuch-hello-all-tags
+++ b/test/emacs.expected-output/notmuch-hello-all-tags
@@ -1,9 +1,5 @@
Welcome to notmuch. You have 52 messages.
 
-Saved searches: [edit]
-
- 52 inbox   52 unread  52 all mail
-
 Search: .
 
 All tags: [hide]
-- 
2.34.1

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH 2/2] emacs: define, use option :disable-excludes for n-h-query-counts

2022-01-22 Thread David Bremner
Initially only use in notmuch-hello-insert-alltags. This is a more
narrow resolution of [1], which (unlike [2]) does not disable exclude
processing for regular saved searches.

[1]: id:87wox1vovj.fsf@len.workgroup
[2]: id:20220105010606.2034601-2-da...@tethera.net
---
 emacs/notmuch-hello.el | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 71e91093..581e7f3a 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -557,7 +557,8 @@ with any properties in the original saved-search.
 
 The values :show-empty-searches, :filter and :filter-count from
 options will be handled as specified for
-`notmuch-hello-insert-searches'."
+`notmuch-hello-insert-searches'. :disable-includes can be used to
+turn off the default exclude processing in `notmuch-count(1)'"
   (with-temp-buffer
 (dolist (elem query-list nil)
   (let ((count-query (or (notmuch-saved-search-get elem :count-query)
@@ -570,7 +571,11 @@ options will be handled as specified for
(plist-get options :filter
 "\n")))
 (unless (= (notmuch--call-process-region (point-min) (point-max) 
notmuch-command
-   t t nil "count" "--batch") 0)
+t t nil "count"
+(if (plist-get options 
:disable-excludes)
+"--exclude=false"
+  "--exclude=true")
+"--batch") 0)
   (notmuch-logged-error
"notmuch count --batch failed"
"Please check that the notmuch CLI is new enough to support `count
@@ -917,7 +922,8 @@ following:
nil
:initially-hidden (not notmuch-show-all-tags-list)
:hide-tags notmuch-hello-hide-tags
-   :filter notmuch-hello-tag-list-make-query))
+   :filter notmuch-hello-tag-list-make-query
+   :disable-excludes t))
 
 (defun notmuch-hello-insert-footer ()
   "Insert the notmuch-hello footer."
-- 
2.34.1

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Attempt 2 to fix the all-tags display with excludes

2022-01-22 Thread David Bremner
The previous fix applied to master was too broad, and turned of
excludes for all counts in notmuch hello. This made the message counts
potentially inflated compared to the searches that actually show up
for saved searches. This fix treats "all tags" as a special case, but
leaves the behaviour of user defined saved searches unaffected.


___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: confirm bug fixed (was: Bug? notmuch-emacs: "All tags" in notmuch-hello does not show all tags)

2022-01-22 Thread David Bremner
Gregor Zattler  writes:
> I confirm, the bug does not show up in my test case from
> message id:877ep0kx52.fsf@len.workgroup
>
> Thanks for this bug fix and for notmuch in general, Gregor

Hey, thanks for checking. I think the fix may have broken something
else, since now the counts displayed have have excludes turned off
(which makes e.g. my inbox look much larger). I'll have to try to
understand this bit of code better.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


confirm bug fixed (was: Bug? notmuch-emacs: "All tags" in notmuch-hello does not show all tags)

2022-01-22 Thread Gregor Zattler
Hi David, Tomi, notmuch developers,
* David Bremner  [2022-01-20; 15:51]:
> Tomi Ollila  writes:
>> Yes, I can reproduce -- only "spam" is seen
>>
>> To look what happened I ran (in notmuch source dir):
>>
>> $ NOTMUCH_CONFIG=/tmp/.notmuch-config strace -f -e trace=execve,read,write 
>> -o ttt ./devel/try-emacs-mua -Q
>>
>> based on that output:
>>
>> $ NOTMUCH_CONFIG=/tmp/.notmuch-config notmuch search --output=tags '*'
>> certaintag
>> inbox
>> new
>> spam
>>
>> $ NOTMUCH_CONFIG=/tmp/.notmuch-config notmuch count --batch
>> tag:certaintag
>> 0
>> tag:new
>> 0
>> tag:spam
>> 1
>> tag:inbox
>> 0
>> tag:foobar
>> 0
>>
>> NOTMUCH_CONFIG=/tmp/.notmuch-config notmuch count --batch --exclude=false
>> tag:certaintag
>> 1
>> tag:new
>> 1
>> tag:spam
>> 1
>> tag:inbox
>> 1
>>
>> 1
>> tag:foobar
>> 0
>>
>> So, currently, whenever count is zero, the tag is now shown in all tags
>> listing (but we know we have the tag since queried earlier). But, at least
>> in this case we should get real count and have that '--exclude=false' there,
>> and then the count is always positive number.
>>
>> At least some SMOP is required to get this fixed.

> This bug should be fixed in commit
>
>  cc180507b03d9826c92d48ee91dbd9bb5f15cd56

I confirm, the bug does not show up in my test case from
message id:877ep0kx52.fsf@len.workgroup

Thanks for this bug fix and for notmuch in general, Gregor
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org