Re: [PATCH 0/3] ruby: get rid of FileNames object

2023-03-27 Thread David Bremner
Felipe Contreras writes: > We don't need a FileNames enumerable object only for a small number of > strings, > we can just get them directly. > > This iterator is meant to be transient and works only once, so we better just > iterate it once. > > This is the same approach I took with the Tags

[PATCH 2/3] ruby: filenames: return string array directly

2023-03-27 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- bindings/ruby/filenames.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/ruby/filenames.c b/bindings/ruby/filenames.c index 17873393..17ec4406 100644 --- a/bindings/ruby/filenames.c +++ b/bindings/ruby/filenames.c @@ -23,7

[PATCH 3/3] ruby: remove FileNames object

2023-03-27 Thread Felipe Contreras
Not used anymore now that we return an array of strings directly. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 10 bindings/ruby/filenames.c | 52 --- bindings/ruby/init.c | 14 --- 3 files changed, 76 deletions(-)

[PATCH 1/3] ruby: add filenames helper

2023-03-27 Thread Felipe Contreras
Right now it doesn't do much, but it will help for further reorganization. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 3 +++ bindings/ruby/directory.c | 4 ++-- bindings/ruby/filenames.c | 6 ++ bindings/ruby/message.c | 2 +- 4 files changed, 12 insertions(+), 3

[PATCH 0/3] ruby: get rid of FileNames object

2023-03-27 Thread Felipe Contreras
We don't need a FileNames enumerable object only for a small number of strings, we can just get them directly. This iterator is meant to be transient and works only once, so we better just iterate it once. This is the same approach I took with the Tags object, I was waiting for feedback on that

Re: [PATCH 2/2] lib/message-property: catch xapian exceptions

2023-03-27 Thread Kevin Boulain
On 2023-03-27 at 08:30 -03, David Bremner wrote: > So you should probably test that the status is not success, and > ideally print the message. You can see some examples in > T560-lib-error.sh, in particular in the created file c_tail which > handles checking the error code and printing the

[PATCH v2 2/2] lib/message-property: catch xapian exceptions

2023-03-27 Thread Kevin Boulain
Since libnotmuch exposes a C interface there's no way for clients to catch this. Inspired by what's done for tags (see notmuch_message_remove_tag). --- lib/message-property.cc | 36 +-- test/T610-message-property.sh | 2 -- 2 files changed, 30 insertions(+),

[PATCH v2 1/2] test: uncaught exception when editing properties of a removed message

2023-03-27 Thread Kevin Boulain
These two functions don't fail gracefully when editing a removed message: BROKEN edit property on removed message without uncaught exception --- T610-message-property.20.EXPECTED 2023-02-27 11:33:25.792764376 + +++ T610-message-property.20.OUTPUT 2023-02-27

Re: [PATCH 2/2] lib/message-property: catch xapian exceptions

2023-03-27 Thread David Bremner
Kevin Boulain writes: > Since libnotmuch exposes a C interface there's no way for clients to > diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh > index 944e1810..f7cabe4d 100755 > --- a/test/T610-message-property.sh > +++ b/test/T610-message-property.sh > @@ -363,7