unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: David Bremner <david@tethera.net>
Cc: "notmuch@notmuchmail.org" <notmuch@notmuchmail.org>,
	Ludovic LANGE <ll-notmuchmail@lange.nom.fr>,
	Stefano Zacchiroli <zack@upsilon.cc>
Subject: Re: [PATCH v2 1/2] ruby: add keyword arguments to db.query
Date: Mon, 28 Jun 2021 02:46:25 -0500	[thread overview]
Message-ID: <CAMP44s1ZtUC2cyhS0zTL_iHmeQ0kMc1D9BE6U4kupFaUPx8qGQ@mail.gmail.com> (raw)
In-Reply-To: <87k0mf1b0q.fsf@tethera.net>

On Sun, Jun 27, 2021 at 12:18 PM David Bremner <david@tethera.net> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > That way we don't need pass them to the query object ourselves.
>
> I have applied this change to master. As we discussed previously, I
> prefer to leave the sort order explicit in the tests.

OK. I still maintain that I see no point in doing this.

Just to find out what would happen if in the future the default
changed, I used NOTMUCH_SORT_UNSORTED instead of
NOTMUCH_SORT_NEWEST_FIRST in just two places and the result is 32
tests failing.

That does *not* include T395-ruby.sh.

In order for the ruby tests to fail the default in notmuch-search.c
has to be different from the default in lib/query.cc--I don't know why
notmuch-search.c doesn't use the true default.

But these are the tests that are *already* in the master branch. My
changes would not make the situation significantly worse.

I think if we really wanted to make the tests (and the binaries) truly
sort-agnostic, a lot more work is needed--and that's mostly orthogonal
to the changes I proposed to the ruby tests.

diff --git a/lib/query.cc b/lib/query.cc
index 792aba21..b618bf42 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -107,7 +107,7 @@ notmuch_query_create (notmuch_database_t *notmuch,

     query->query_string = talloc_strdup (query, query_string);

-    query->sort = NOTMUCH_SORT_NEWEST_FIRST;
+    query->sort = NOTMUCH_SORT_UNSORTED;

     query->exclude_terms = _notmuch_string_list_create (query);

diff --git a/notmuch-search.c b/notmuch-search.c
index 244817a9..83329a4d 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -770,7 +770,7 @@ _notmuch_search_cleanup (search_context_t *ctx)
 static search_context_t search_context = {
     .format_sel = NOTMUCH_FORMAT_TEXT,
     .exclude = NOTMUCH_EXCLUDE_TRUE,
-    .sort = NOTMUCH_SORT_NEWEST_FIRST,
+    .sort = NOTMUCH_SORT_UNSORTED,
     .output = 0,
     .offset = 0,
     .limit = -1, /* unlimited */


-- 
Felipe Contreras

  reply	other threads:[~2021-06-28  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  2:19 [PATCH v2 0/2] ruby: improve db.query Felipe Contreras
2021-05-24  2:19 ` [PATCH v2 1/2] ruby: add keyword arguments to db.query Felipe Contreras
2021-06-27 17:18   ` David Bremner
2021-06-28  7:46     ` Felipe Contreras [this message]
2021-05-24  2:19 ` [PATCH v2 2/2] test: ruby: simplify basic tests Felipe Contreras
2021-06-04  6:08 ` [PATCH v2 0/2] ruby: improve db.query Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s1ZtUC2cyhS0zTL_iHmeQ0kMc1D9BE6U4kupFaUPx8qGQ@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=david@tethera.net \
    --cc=ll-notmuchmail@lange.nom.fr \
    --cc=notmuch@notmuchmail.org \
    --cc=zack@upsilon.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).