1 Return-Path: <tomi.ollila@nixu.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id DDD3B429E21
\r
6 for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 09:41:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id tKR5aF1avf3c for <notmuch@notmuchmail.org>;
\r
16 Wed, 16 Nov 2011 09:41:28 -0800 (PST)
\r
17 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id F1EF4431FD0
\r
21 for <notmuch@notmuchmail.org>; Wed, 16 Nov 2011 09:41:27 -0800 (PST)
\r
22 Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])
\r
23 by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
\r
24 pAGHfNFh007787; Wed, 16 Nov 2011 19:41:23 +0200
\r
25 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
26 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
27 Subject: Re: [PATCH v2] tag: Automatically limit to messages whose tags will
\r
29 In-Reply-To: <1320846275-28520-1-git-send-email-amdragon@mit.edu>
\r
30 References: <1320724523-23568-1-git-send-email-amdragon@mit.edu>
\r
31 <1320846275-28520-1-git-send-email-amdragon@mit.edu>
\r
32 User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1
\r
34 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
35 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
36 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
37 Date: Wed, 16 Nov 2011 19:41:23 +0200
\r
38 Message-ID: <yf6hb24rmm4.fsf@taco2.nixu.fi>
\r
40 Content-Type: text/plain; charset=us-ascii
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 16 Nov 2011 17:41:29 -0000
\r
55 On Wed, 9 Nov 2011 08:44:35 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
\r
56 > This optimizes the user's tagging query to exclude messages that won't
\r
57 > be affected by the tagging operation, saving computation and IO for
\r
58 > redundant tagging operations.
\r
61 > notmuch tag +notmuch to:notmuch@notmuchmail.org
\r
62 > will now use the query
\r
63 > ( to:notmuch@notmuchmail.org ) and (not tag:"notmuch")
\r
65 > In the past, we've often suggested that people do this exact
\r
66 > transformation by hand for slow tagging operations. This makes that
\r
69 > This version addresses Jani's comments.
\r
72 > notmuch-tag.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\r
73 > 2 files changed, 94 insertions(+), 0 deletions(-)
\r
76 Reviewed code, looks good
\r
78 * Empty query string checked before entering _optimize_tag_query
\r
80 * All allocations checked
\r
81 * The logic look sound and creation of that query string is ok, too.
\r
82 * I trust escaping is done the way it is done (quotes around, doubling
\r
83 any quotes (") in string).
\r
85 * orig_query_string could be freed in _optimize_query_string()
\r
86 the data becomes garbage pointer to it lost after that call.
\r
87 However, _optimize_query_string() doesn't know that so it is
\r
88 better to leave talloc do the freeing (a bit later).
\r