unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Peter Wang <novalazy@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t
Date: Sun, 21 Oct 2012 15:10:40 +0300	[thread overview]
Message-ID: <m24nlo2fgf.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20121021130427.GA4820@hili.localdomain>

On Sun, Oct 21 2012, Peter Wang wrote:

> On Fri, 19 Oct 2012 01:15:31 -0400, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
>> Peter Wang <novalazy@gmail.com> writes:
>> 
>> > Add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t so that it can
>> > cover all four values of search --exclude in the cli.
>> 
>> This series looks good to me. It's a nice clean up and a nice new
>> feature. Patches all apply.
>
> Thanks for the review.
>
>> However, I'm getting test failures like:
>> 
>>  FAIL   Search, exclude "deleted" messages from message search --exclude=false
>>         --- excludes.3.expected 2012-10-19 04:45:06.900518377 +0000
>>         +++ excludes.3.output   2012-10-19 04:45:06.900518377 +0000
>>         @@ -1,2 +1,2 @@
>>         -id:msg-001@notmuch-test-suite
>>          id:msg-002@notmuch-test-suite
>>         +id:msg-001@notmuch-test-suite
>> 
>>  FAIL   Search, don't exclude "deleted" messages when --exclude=flag specified
>>         --- excludes.7.expected 2012-10-19 04:45:07.004518378 +0000
>>         +++ excludes.7.output   2012-10-19 04:45:07.004518378 +0000
>>         @@ -1,2 +1,2 @@
>>         -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
>>          thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)
>>         +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
>> 
>>  FAIL   Search, don't exclude "deleted" messages from search if not configured
>>         --- excludes.8.expected 2012-10-19 04:45:07.028518377 +0000
>>         +++ excludes.8.output   2012-10-19 04:45:07.028518377 +0000
>>         @@ -1,2 +1,2 @@
>>         -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
>>          thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)
>>         +thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
>> 
>> In other words, threads and messages are coming up out of order. I'm not
>> sure of the right way to fix this. If you would like me to try sticking
>> "| sort" here and there in the tests I will do so. I'm not sure if the
>> test suite is guaranteed to scan messages in a certain order.
>
> Does it help if you add a "sleep 1" before the second generate_message
> call, i.e. on line 35?
>
>> > -         if (query->omit_excluded != NOTMUCH_EXCLUDE_FALSE)
>> > +         if (query->omit_excluded == NOTMUCH_EXCLUDE_TRUE ||
>> > +             query->omit_excluded == NOTMUCH_EXCLUDE_ALL)
>> > +         {
>> >               final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
>> >                                            final_query, exclude_query);
>> > -         else {
>> > +         } else {
>> 
>> "House style" is to not put braces around one-line then-clauses. This is
>> the only place where you did that.
>
> I have to disagree.  The condition is wrapped over two lines.  The then
> part is wrapped over two lines.  The else part already has braces.
> All suggest braces around the then part.

Well, I personally would count none of these as convincing suggestions ;),
but IMHO the braces are OK here (I don't start judging which I'd like more).

> Peter

Tomi

  reply	other threads:[~2012-10-21 12:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 13:28 [PATCH 0/8] search --exclude=all Peter Wang
2012-06-20 13:29 ` [PATCH 1/8] lib: add --exclude=all option Peter Wang
2013-05-11 18:07   ` David Bremner
2012-06-20 13:29 ` [PATCH 2/8] cli: add --exclude=all option to notmuch-search.c Peter Wang
2012-06-20 13:29 ` [PATCH 3/8] test: add tests for search --exclude=all Peter Wang
2012-06-20 13:29 ` [PATCH 4/8] man: clarify search --exclude documentation Peter Wang
2012-06-20 20:08   ` Mark Walters
2012-06-23  2:02     ` Peter Wang
2012-06-23  7:14       ` Mark Walters
2012-06-20 13:29 ` [PATCH 5/8] man: clarify search --exclude=flag Peter Wang
2012-06-20 13:29 ` [PATCH 6/8] man: document search --exclude=all Peter Wang
2012-06-20 13:29 ` [PATCH 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t Peter Wang
2012-10-19  5:15   ` Ethan Glasser-Camp
2012-10-19 21:23     ` Ethan Glasser-Camp
2012-10-20 10:04       ` Tomi Ollila
2012-10-21  2:04     ` Peter Wang
2012-10-21 12:10       ` Tomi Ollila [this message]
2012-10-21 13:03       ` Ethan Glasser-Camp
2012-06-20 13:29 ` [PATCH 8/8] cli: use notmuch_exclude_t in option parser Peter Wang
2012-07-22  1:18 ` [PATCH v2 4/8] man: clarify search --exclude documentation Peter Wang

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=m24nlo2fgf.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    --cc=novalazy@gmail.com \
    /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).