Re: muchsync files renames
[notmuch-archives.git] / ae / 347c488beb583e113a2b822285c85c4629afc5
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
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\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
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\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
50 \r
51 On Tue, Jan 08 2013, Jani Nikula wrote:\r
52 \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
57 > ---\r
58 \r
59 LGTM.\r
60 \r
61 Tomi\r
62 \r
63 \r
64 >  notmuch-tag.c |    7 +++++--\r
65 >  1 file changed, 5 insertions(+), 2 deletions(-)\r
66 >\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
75 > +    int ret = 0;\r
76 >  \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
86 > +     if (ret)\r
87 > +         break;\r
88 >      }\r
89 >  \r
90 >      notmuch_query_destroy (query);\r
91 >  \r
92 > -    return interrupted;\r
93 > +    return ret || interrupted;\r
94 >  }\r
95 >  \r
96 >  static int\r
97 > -- \r
98 > 1.7.10.4\r
99 >\r
100 > _______________________________________________\r
101 > notmuch mailing list\r
102 > notmuch@notmuchmail.org\r
103 > http://notmuchmail.org/mailman/listinfo/notmuch\r