* potential fix for wrong error message
@ 2023-12-03 19:01 David Bremner
2023-12-03 19:01 ` [PATCH 1/2] test: add known broken test for incorrect " David Bremner
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David Bremner @ 2023-12-03 19:01 UTC (permalink / raw)
To: notmuch; +Cc: hi
Hi Alyssa
I'm not sure if this is a fix for your bug, but it is a fix for a
very similar bug.
d
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] test: add known broken test for incorrect error message
2023-12-03 19:01 potential fix for wrong error message David Bremner
@ 2023-12-03 19:01 ` David Bremner
2023-12-03 19:01 ` [PATCH 2/2] lib: clear error message on success in _choose_database_path David Bremner
2023-12-03 19:47 ` potential fix for wrong error message Alyssa Ross
2 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2023-12-03 19:01 UTC (permalink / raw)
To: notmuch; +Cc: hi
Duplicate bug reported in id:87wmtvcor5.fsf@alyssa.is
The error message is nonsense, because notmuch config list actually
includes the database in those two cases.
---
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 efc79e8b..fcaf09d3 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -374,6 +374,12 @@ EOF
notmuch new
test_expect_equal "$(xapian-metadata get ${XAPIAN_PATH} version)" 3
;;
+ home_mail|maildir_env)
+ test_begin_subtest "No errors from config list ($config)"
+ test_subtest_known_broken
+ notmuch config list 2>OUTPUT 1>/dev/null
+ test_expect_equal_file /dev/null OUTPUT
+ ;;
*)
backup_database
test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)"
--
2.42.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] lib: clear error message on success in _choose_database_path
2023-12-03 19:01 potential fix for wrong error message David Bremner
2023-12-03 19:01 ` [PATCH 1/2] test: add known broken test for incorrect " David Bremner
@ 2023-12-03 19:01 ` David Bremner
2023-12-03 19:47 ` potential fix for wrong error message Alyssa Ross
2 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2023-12-03 19:01 UTC (permalink / raw)
To: notmuch; +Cc: hi
Previously we both found a database and returned a message saying that
the database could not be found (along with a success code). This
change should prevent spurious error output.
---
lib/open.cc | 5 +++++
test/T055-path-config.sh | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/open.cc b/lib/open.cc
index 005872dc..463e38bf 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -249,6 +249,11 @@ _choose_database_path (notmuch_database_t *notmuch,
return NOTMUCH_STATUS_NO_DATABASE;
}
+ if (*message) {
+ free (*message);
+ *message = NULL;
+ }
+
return NOTMUCH_STATUS_SUCCESS;
}
diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index fcaf09d3..1feb5624 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -376,7 +376,6 @@ EOF
;;
home_mail|maildir_env)
test_begin_subtest "No errors from config list ($config)"
- test_subtest_known_broken
notmuch config list 2>OUTPUT 1>/dev/null
test_expect_equal_file /dev/null OUTPUT
;;
--
2.42.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: potential fix for wrong error message
2023-12-03 19:01 potential fix for wrong error message David Bremner
2023-12-03 19:01 ` [PATCH 1/2] test: add known broken test for incorrect " David Bremner
2023-12-03 19:01 ` [PATCH 2/2] lib: clear error message on success in _choose_database_path David Bremner
@ 2023-12-03 19:47 ` Alyssa Ross
2023-12-06 11:42 ` David Bremner
2 siblings, 1 reply; 5+ messages in thread
From: Alyssa Ross @ 2023-12-03 19:47 UTC (permalink / raw)
To: David Bremner; +Cc: notmuch
[-- Attachment #1.1: Type: text/plain, Size: 225 bytes --]
David Bremner <david@tethera.net> writes:
> Hi Alyssa
>
> I'm not sure if this is a fix for your bug, but it is a fix for a
> very similar bug.
This is a fix for my bug, thanks a lot!
Tested-by: Alyssa Ross <hi@alyssa.is>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-12-06 11:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-03 19:01 potential fix for wrong error message David Bremner
2023-12-03 19:01 ` [PATCH 1/2] test: add known broken test for incorrect " David Bremner
2023-12-03 19:01 ` [PATCH 2/2] lib: clear error message on success in _choose_database_path David Bremner
2023-12-03 19:47 ` potential fix for wrong error message Alyssa Ross
2023-12-06 11:42 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).