From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 86F206DE02B0 for ; Wed, 31 Aug 2016 18:16:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XhslPkYuojhW for ; Wed, 31 Aug 2016 18:16:50 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id F269A6DE00DD for ; Wed, 31 Aug 2016 18:16:49 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bfGcT-0005eZ-4r; Wed, 31 Aug 2016 21:16:41 -0400 Received: (nullmailer pid 22993 invoked by uid 1000); Thu, 01 Sep 2016 01:16:43 -0000 From: David Bremner To: Franz Fellner , Lucas Hoffmann , notmuch@notmuchmail.org Subject: Re: Bug: counting messages twice after excluding tags yields different results In-Reply-To: <1.472.648.167-ner-3.768@TP_L520> References: <147263183913.27784.12274024193186585889@mbp> <1.472.635.278-ner-3.934@TP_L520> <147264220228.31988.2941265478027864869@mbp> <87vayhku3f.fsf@zancas.localnet> <1.472.648.167-ner-3.768@TP_L520> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Wed, 31 Aug 2016 22:16:43 -0300 Message-ID: <87a8fsl8qs.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Thu, 01 Sep 2016 01:16:51 -0000 Franz Fellner writes: > On Wed, 31 Aug 2016 09:20:52 -0300, David Bremner wrote: >> Lucas Hoffmann writes: >> >> > Thank you Franz, sadly your reply did not convince me: >> > >> > Quoting Franz Fellner (2016-08-31 11:21:18) >> >> Your problem: the example sucks ;) >> > >> > No, I must object :( >> > >> >> If the query searches for a tag you also have in exclude_tags (in your >> >> case: spam) the exclude gets ignored. >> > >> > Is that documented? Because it is not what I would expect. >> >> Yes, it is documented in notmuch-config(1) > > And for "destructiveness" see the implementation in lib/query.cc _notmuch_exclude_tags: > It replaces every matching tag in query_string and exclude_tags with an empty string "" > in the exclude terms. This most likely results in which can be > seen as a bug, if you want; removing would be better but also more expensive. Maybe more programming effort, but I guess not more expensive in performance? It is not clear that this is worth fixing, since the destructiveness makes re-using queries inadvisable. Are there any non-destructive operations on queries (that it seems reasonable to commit to being non-destructive)? Otherwise, I guess we could just add a blanket warning to the API docs. d