1 Return-Path: <tomi.ollila@iki.fi>
\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 C6B4D431FB6
\r
6 for <notmuch@notmuchmail.org>; Tue, 8 Jan 2013 15:51:19 -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 lpusfPIcN-Wr for <notmuch@notmuchmail.org>;
\r
16 Tue, 8 Jan 2013 15:51:19 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id E11C3431FAE
\r
19 for <notmuch@notmuchmail.org>; Tue, 8 Jan 2013 15:51:18 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id C0BD51000D0;
\r
22 Wed, 9 Jan 2013 01:51:08 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] cli: bail out and propagate tagging errors in notmuch tag
\r
26 In-Reply-To: <1357681314-29384-1-git-send-email-jani@nikula.org>
\r
27 References: <1357681314-29384-1-git-send-email-jani@nikula.org>
\r
28 User-Agent: Notmuch/0.14+247~gf806a85 (http://notmuchmail.org) Emacs/24.2.1
\r
29 (x86_64-unknown-linux-gnu)
\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
31 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
32 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
33 Date: Wed, 09 Jan 2013 01:51:08 +0200
\r
34 Message-ID: <m2d2xftes3.fsf@guru.guru-group.fi>
\r
36 Content-Type: text/plain
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Tue, 08 Jan 2013 23:51:20 -0000
\r
51 On Tue, Jan 08 2013, Jani Nikula wrote:
\r
53 > Checking and propagating tag_op_list_apply() errors is especially
\r
54 > important with batch tagging, as the processing of the batch input
\r
55 > would not stop otherwise. Additionally this sets the exit code, which
\r
56 > is useful in scripts.
\r
64 > notmuch-tag.c | 7 +++++--
\r
65 > 1 file changed, 5 insertions(+), 2 deletions(-)
\r
67 > diff --git a/notmuch-tag.c b/notmuch-tag.c
\r
68 > index 4272426..16b1668 100644
\r
69 > --- a/notmuch-tag.c
\r
70 > +++ b/notmuch-tag.c
\r
71 > @@ -97,6 +97,7 @@ tag_query (void *ctx, notmuch_database_t *notmuch, const char *query_string,
\r
72 > notmuch_query_t *query;
\r
73 > notmuch_messages_t *messages;
\r
74 > notmuch_message_t *message;
\r
77 > /* Optimize the query so it excludes messages that already have
\r
78 > * the specified set of tags. */
\r
79 > @@ -119,13 +120,15 @@ tag_query (void *ctx, notmuch_database_t *notmuch, const char *query_string,
\r
80 > notmuch_messages_valid (messages) && ! interrupted;
\r
81 > notmuch_messages_move_to_next (messages)) {
\r
82 > message = notmuch_messages_get (messages);
\r
83 > - tag_op_list_apply (message, tag_ops, flags | TAG_FLAG_PRE_OPTIMIZED);
\r
84 > + ret = tag_op_list_apply (message, tag_ops, flags | TAG_FLAG_PRE_OPTIMIZED);
\r
85 > notmuch_message_destroy (message);
\r
90 > notmuch_query_destroy (query);
\r
92 > - return interrupted;
\r
93 > + return ret || interrupted;
\r
100 > _______________________________________________
\r
101 > notmuch mailing list
\r
102 > notmuch@notmuchmail.org
\r
103 > http://notmuchmail.org/mailman/listinfo/notmuch
\r