1 Return-Path: <bremner@tethera.net>
\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 23A9C429E54
\r
6 for <notmuch@notmuchmail.org>; Mon, 10 Oct 2011 06:50:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 GiHAtv-xuVXc for <notmuch@notmuchmail.org>;
\r
16 Mon, 10 Oct 2011 06:50:04 -0700 (PDT)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\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 0D3E4429E42
\r
21 for <notmuch@notmuchmail.org>; Mon, 10 Oct 2011 06:49:58 -0700 (PDT)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034064058.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.64.58]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9ADnt1l010829
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Mon, 10 Oct 2011 10:49:56 -0300
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RDGEq-0006ft-A9; Mon, 10 Oct 2011 10:49:52 -0300
\r
31 From: david@tethera.net
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH 4/6] notmuch-dump: treat any remaining arguments after the
\r
34 filename as search terms
\r
35 Date: Mon, 10 Oct 2011 10:49:19 -0300
\r
36 Message-Id: <1318254561-25386-5-git-send-email-david@tethera.net>
\r
37 X-Mailer: git-send-email 1.7.6.3
\r
38 In-Reply-To: <1318254561-25386-1-git-send-email-david@tethera.net>
\r
39 References: <8739f2qhla.fsf@zancas.localnet>
\r
40 <1318254561-25386-1-git-send-email-david@tethera.net>
\r
41 Cc: David Bremner <bremner@debian.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Mon, 10 Oct 2011 13:50:06 -0000
\r
56 From: David Bremner <bremner@debian.org>
\r
58 The main motivation here is allow the fast dumping of tag data for
\r
59 messages having certain tags. In practice it seems too slow to pipe
\r
62 notmuch-dump.c | 11 ++++++++++-
\r
63 1 files changed, 10 insertions(+), 1 deletions(-)
\r
65 diff --git a/notmuch-dump.c b/notmuch-dump.c
\r
66 index 610144e..ac5d074 100644
\r
67 --- a/notmuch-dump.c
\r
68 +++ b/notmuch-dump.c
\r
69 @@ -30,6 +30,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
\r
70 notmuch_messages_t *messages;
\r
71 notmuch_message_t *message;
\r
72 notmuch_tags_t *tags;
\r
73 + const char* query_str = "";
\r
75 config = notmuch_config_open (ctx, NULL, NULL);
\r
77 @@ -56,7 +57,15 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
\r
81 - query = notmuch_query_create (notmuch, "");
\r
83 + query_str = query_string_from_args (notmuch, argc, argv);
\r
84 + if (query_str == NULL) {
\r
85 + fprintf (stderr, "Out of memory.\n");
\r
90 + query = notmuch_query_create (notmuch, query_str);
\r
91 if (query == NULL) {
\r
92 fprintf (stderr, "Out of memory\n");
\r