1 Return-Path: <m.walters@qmul.ac.uk>
\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 C5EED431FB6
\r
6 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:13:10 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id 3VVO-cwvzUlA for <notmuch@notmuchmail.org>;
\r
17 Sun, 16 Dec 2012 13:13:08 -0800 (PST)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 8B0CF431FAE
\r
22 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:13:08 -0800 (PST)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1TkLWD-0004UY-Kx; Sun, 16 Dec 2012 21:13:06 +0000
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1TkLWD-0001Gi-5z; Sun, 16 Dec 2012 21:13:05 +0000
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH v3 0/5] add --format=text0 to notmuch search
\r
34 In-Reply-To: <cover.1355691124.git.jani@nikula.org>
\r
35 References: <cover.1355691124.git.jani@nikula.org>
\r
36 User-Agent: Notmuch/0.14+226~ge56ae2a (http://notmuchmail.org) Emacs/23.4.1
\r
37 (x86_64-pc-linux-gnu)
\r
38 Date: Sun, 16 Dec 2012 21:13:08 +0000
\r
39 Message-ID: <87d2y9em57.fsf@qmul.ac.uk>
\r
41 Content-Type: text/plain; charset=us-ascii
\r
42 X-Sender-Host-Address: 93.97.24.31
\r
43 X-QM-SPAM-Info: Sender has good ham record. :)
\r
44 X-QM-Body-MD5: ebaf31bafb9a55eaf407f92678b36c43 (of first 20000 bytes)
\r
45 X-SpamAssassin-Score: -1.8
\r
46 X-SpamAssassin-SpamBar: -
\r
47 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
49 spam. We require at least 5.0 points to mark a message as spam.
\r
50 This message scored -1.8 points.
\r
51 Summary of the scoring:
\r
52 * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,
\r
54 * [138.37.6.40 listed in list.dnswl.org]
\r
55 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
56 provider * (markwalters1009[at]gmail.com)
\r
57 * 0.5 AWL AWL: From: address is in the auto white-list
\r
58 X-QM-Scan-Virus: ClamAV says the message is clean
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sun, 16 Dec 2012 21:13:10 -0000
\r
73 On Sun, 16 Dec 2012, Jani Nikula <jani@nikula.org> wrote:
\r
74 > Hi all, v3 of id:cover.1355064714.git.jani@nikula.org
\r
77 > * add new patch 1/5 to clarify sprinter documentation
\r
78 > * fix the test patch 4/5 according to id:8738z6wguj.fsf@qmul.ac.uk and
\r
79 > id:87y5gyvvv7.fsf@awakening.csail.mit.edu
\r
81 > Diff to v2 at the end of the cover letter.
\r
98 > sprinter: clarify separator documentation
\r
99 > sprinter: add text0 formatter for null character separated text
\r
100 > cli: add --format=text0 to notmuch search
\r
101 > test: notmuch search --format=text0
\r
102 > man: document notmuch search --format=text0
\r
104 > man/man1/notmuch-search.1 | 26 ++++++++++++++++----------
\r
105 > notmuch-search.c | 16 ++++++++++++++--
\r
106 > sprinter-text.c | 22 ++++++++++++++++++++++
\r
107 > sprinter.h | 15 +++++++++++----
\r
108 > test/text | 33 +++++++++++++++++++++++++++++++++
\r
109 > 5 files changed, 96 insertions(+), 16 deletions(-)
\r
116 > diff --git a/sprinter.h b/sprinter.h
\r
117 > index f36b999..f859672 100644
\r
120 > @@ -42,10 +42,11 @@ typedef struct sprinter {
\r
122 > void (*map_key) (struct sprinter *, const char *);
\r
124 > - /* Insert a separator (usually extra whitespace) for improved
\r
125 > - * readability without affecting the abstract syntax of the
\r
126 > - * structure being printed.
\r
127 > - * For JSON, this could simply be a line break.
\r
128 > + /* Insert a separator (usually extra whitespace). For the text
\r
129 > + * printers, this is a syntactic separator. For the structured
\r
130 > + * printers, this is for improved readability without affecting
\r
131 > + * the abstract syntax of the structure being printed. For JSON,
\r
132 > + * this could simply be a line break.
\r
134 > void (*separator) (struct sprinter *);
\r
136 > diff --git a/test/text b/test/text
\r
137 > index e003a66..b5ccefc 100755
\r
140 > @@ -55,30 +55,34 @@ test_expect_equal "$output" \
\r
143 > test_begin_subtest "Search message tags: text0"
\r
144 > -cat <<EOF > EXPECTED.$test_count
\r
145 > +cat <<EOF > EXPECTED
\r
146 > attachment inbox signed unread
\r
148 > -notmuch search --format=text0 --output=tags '*' | xargs -0 | notmuch_search_sanitize > OUTPUT.$test_count
\r
149 > -test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
150 > +notmuch search --format=text0 --output=tags '*' | xargs -0 | notmuch_search_sanitize > OUTPUT
\r
151 > +test_expect_equal_file EXPECTED OUTPUT
\r
153 > +# Use tr(1) to convert --output=text0 to --output=text for
\r
154 > +# comparison. Also translate newlines to spaces to fail with more
\r
155 > +# noise if they are present as delimiters instead of null
\r
156 > +# characters. This assumes there are no newlines in the data.
\r
157 > test_begin_subtest "Compare text vs. text0 for threads"
\r
158 > -notmuch search --format=text --output=threads '*' | notmuch_search_sanitize > EXPECTED.$test_count
\r
159 > -notmuch search --format=text0 --output=threads '*' | xargs -0 -L1 | notmuch_search_sanitize > OUTPUT.$test_count
\r
160 > -test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
161 > +notmuch search --format=text --output=threads '*' | notmuch_search_sanitize > EXPECTED
\r
162 > +notmuch search --format=text0 --output=threads '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT
\r
163 > +test_expect_equal_file EXPECTED OUTPUT
\r
165 > test_begin_subtest "Compare text vs. text0 for messages"
\r
166 > -notmuch search --format=text --output=messages '*' | notmuch_search_sanitize > EXPECTED.$test_count
\r
167 > -notmuch search --format=text0 --output=messages '*' | xargs -0 -L1 | notmuch_search_sanitize > OUTPUT.$test_count
\r
168 > -test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
169 > +notmuch search --format=text --output=messages '*' | notmuch_search_sanitize > EXPECTED
\r
170 > +notmuch search --format=text0 --output=messages '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT
\r
171 > +test_expect_equal_file EXPECTED OUTPUT
\r
173 > test_begin_subtest "Compare text vs. text0 for files"
\r
174 > -notmuch search --format=text --output=files '*' | notmuch_search_sanitize > EXPECTED.$test_count
\r
175 > -notmuch search --format=text0 --output=files '*' | xargs -0 -L1 | notmuch_search_sanitize > OUTPUT.$test_count
\r
176 > -test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
177 > +notmuch search --format=text --output=files '*' | notmuch_search_sanitize > EXPECTED
\r
178 > +notmuch search --format=text0 --output=files '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT
\r
179 > +test_expect_equal_file EXPECTED OUTPUT
\r
181 > test_begin_subtest "Compare text vs. text0 for tags"
\r
182 > -notmuch search --format=text --output=tags '*' | notmuch_search_sanitize > EXPECTED.$test_count
\r
183 > -notmuch search --format=text0 --output=tags '*' | xargs -0 -L1 | notmuch_search_sanitize > OUTPUT.$test_count
\r
184 > -test_expect_equal_file EXPECTED.$test_count OUTPUT.$test_count
\r
185 > +notmuch search --format=text --output=tags '*' | notmuch_search_sanitize > EXPECTED
\r
186 > +notmuch search --format=text0 --output=tags '*' | tr "\n\0" " \n" | notmuch_search_sanitize > OUTPUT
\r
187 > +test_expect_equal_file EXPECTED OUTPUT
\r