From: Ethan Glasser-Camp Date: Fri, 19 Oct 2012 05:15:31 +0000 (+2000) Subject: Re: [PATCH 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=7baf795c3730af105a4c48aa796ecba834558238;p=notmuch-archives.git Re: [PATCH 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t --- diff --git a/9d/d39bad749bb3efc173c04fa3f582f40f3591f6 b/9d/d39bad749bb3efc173c04fa3f582f40f3591f6 new file mode 100644 index 000000000..58c5ee344 --- /dev/null +++ b/9d/d39bad749bb3efc173c04fa3f582f40f3591f6 @@ -0,0 +1,130 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 8C408431FB6 + for ; Thu, 18 Oct 2012 22:15:37 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.7 +X-Spam-Level: * +X-Spam-Status: No, score=1.7 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id LAqMtJojAxur for ; + Thu, 18 Oct 2012 22:15:37 -0700 (PDT) +Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com + [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0373A431FAE + for ; Thu, 18 Oct 2012 22:15:36 -0700 (PDT) +Received: by mail-vb0-f53.google.com with SMTP id fc21so81425vbb.26 + for ; Thu, 18 Oct 2012 22:15:36 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=TG+0b7+IUvDAs6CSvkHQ4yxkmsaNavgoZKmEsptif5U=; + b=h429bfY1oOvNJ1/4D8B7Du8Nbnr2aLTK2YCa2dSTuKXMUqQkLTvpD2a/N3qarNXdWY + YNJOGv4AmZpMB5drdKz/quSswBmrd838aUHRdFlO+7sRZkQdHhAAXH7GaQjJCIrpBfKu + GccOXynkhUgCynQNMl9dc2tosFB0NWYUd7O5nIIn9xqM6zszTRNwBgVLBPPEogyC6v/H + IEYiEdMReQzzubd+5ZMgI7ZITjm3t1b17uNbYh8P72f6NIvMCLr3aNEz3p7qz/z6E9iR + 33OsvyQdE9VyHtao9vNy8N0i3eF+gHV2kLXYcXNSfasuslk6u2g3ewZjs3k+ZFqJ9K0o + eDjg== +Received: by 10.52.32.1 with SMTP id e1mr120027vdi.68.1350623735992; + Thu, 18 Oct 2012 22:15:35 -0700 (PDT) +Received: from smtp.gmail.com (p70-80.acedsl.com. [66.114.70.80]) + by mx.google.com with ESMTPS id xq19sm741776veb.0.2012.10.18.22.15.34 + (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 18 Oct 2012 22:15:35 -0700 (PDT) +From: Ethan Glasser-Camp +To: Peter Wang , notmuch@notmuchmail.org +Subject: Re: [PATCH 7/8] lib: add NOTMUCH_EXCLUDE_FLAG to notmuch_exclude_t +In-Reply-To: <1340198947-29370-8-git-send-email-novalazy@gmail.com> +References: <1340198947-29370-1-git-send-email-novalazy@gmail.com> + <1340198947-29370-8-git-send-email-novalazy@gmail.com> +User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-pc-linux-gnu) +Date: Fri, 19 Oct 2012 01:15:31 -0400 +Message-ID: <87txtr6o0c.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 19 Oct 2012 05:15:38 -0000 + +Peter Wang 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. + +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. + +Mark Walters wrote in +id:"1340198947-29370-5-git-send-email-novalazy@gmail.com" that he +thought patch 1/8 seemed more intrusive than he liked. Maybe I just have +a higher standard for "intrusive" than he does ;) but I thought it was +fine. + +It looks like you have better wording for patch 4/8 so I'd like to see +you resend it. + +> - 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'm marking patches 3, 4, and 7 as moreinfo. Please resubmit! + +Ethan