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 21C72431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 00:24:42 -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 OHGbSQbaWWtk for <notmuch@notmuchmail.org>;
\r
17 Fri, 7 Nov 2014 00:24:33 -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 06A8B431FAE
\r
22 for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 00:24:32 -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 1Xmeq1-0003xw-Fw; Fri, 07 Nov 2014 08:24:29 +0000
\r
27 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1Xmeq0-0005ZV-S5; Fri, 07 Nov 2014 08:24:09 +0000
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
\r
33 Subject: Re: [PATCH] cli: notmuch address option defaults update
\r
34 In-Reply-To: <1415297516-29203-1-git-send-email-tomi.ollila@iki.fi>
\r
35 References: <1415297516-29203-1-git-send-email-tomi.ollila@iki.fi>
\r
36 User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1
\r
37 (x86_64-pc-linux-gnu)
\r
38 Date: Fri, 07 Nov 2014 08:24:08 +0000
\r
39 Message-ID: <871tpf1krb.fsf@qmul.ac.uk>
\r
41 Content-Type: text/plain; charset=us-ascii
\r
42 X-Sender-Host-Address: 87.81.223.162
\r
43 X-QM-Geographic: According to ripencc,
\r
44 this message was delivered by a machine in Britain (UK) (GB).
\r
45 X-QM-SPAM-Info: Sender has good ham record. :)
\r
46 X-QM-Body-MD5: 76169b25e71e638a9e6f4cac38d4d3ce (of first 20000 bytes)
\r
47 X-SpamAssassin-Score: -0.1
\r
48 X-SpamAssassin-SpamBar: /
\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
51 spam. We require at least 5.0 points to mark a message as spam.
\r
52 This message scored -0.1 points.
\r
53 Summary of the scoring:
\r
54 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
55 provider * (markwalters1009[at]gmail.com)
\r
56 * -0.1 AWL AWL: From: address is in the auto white-list
\r
57 X-QM-Scan-Virus: ClamAV says the message is clean
\r
58 Cc: tomi.ollila@iki.fi
\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: Fri, 07 Nov 2014 08:24:42 -0000
\r
76 On Thu, 06 Nov 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
77 > When no --output option were given, change default to display senders
\r
78 > only. This is faster and provides useful-enough list of addresses.
\r
80 > When only --count option is given, display senders (in contrary to not
\r
81 > displaying anything).
\r
83 > Document how --count affects to "sort order" a bit more accurately.
\r
85 > Clean up some whitespace in the documentation.
\r
87 > One test updated to have --output=count without sender nor recipient
\r
91 > Some quick updates to the notmuch address interface which I hope will
\r
92 > be considered to be included in 0.19 release. As we are in feature freeze
\r
93 > I hope this gets quick feedback, in any way you desire.
\r
95 I have tested it and it basically looks good. (As mentioned
\r
96 on irc) I am mildly in favour of the change to defaulting to
\r
97 output=sender that this patch does.
\r
99 A couple of comments below. Feel free to ignore.
\r
103 > doc/man1/notmuch-address.rst | 34 ++++++++++++++++++----------------
\r
104 > notmuch-search.c | 4 ++--
\r
105 > test/T095-address.sh | 14 +++++++-------
\r
106 > 3 files changed, 27 insertions(+), 25 deletions(-)
\r
108 > diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst
\r
109 > index 359616e0dc5f..034607c434d2 100644
\r
110 > --- a/doc/man1/notmuch-address.rst
\r
111 > +++ b/doc/man1/notmuch-address.rst
\r
112 > @@ -32,28 +32,28 @@ Supported options for **address** include
\r
113 > ``--output=(sender|recipients|count)``
\r
115 > Controls which information appears in the output. This option
\r
116 > - can be given multiple times to combine different outputs.
\r
117 > - Omitting this option is equivalent to
\r
118 > - --output=sender --output=recipients.
\r
119 > + can be given multiple times to combine different outputs.
\r
120 > + Omitting this option is equivalent to --output=sender.
\r
122 Perhaps say, "if neither --output=sender nor --output=recipients is
\r
123 specified then this defaults to --output=sender". (Otherwise the manual
\r
124 does not specify what happens in --output=count case)
\r
128 > Output all addresses from the *From* header.
\r
130 > - Note: Searching for **sender** should be much faster than
\r
131 > - searching for **recipients**, because sender addresses are
\r
132 > - cached directly in the database whereas other addresses
\r
133 > - need to be fetched from message files.
\r
134 > + Note: Searching for **sender** should be much faster than
\r
135 > + searching for **recipients**, because sender addresses are
\r
136 > + cached directly in the database whereas other addresses
\r
137 > + need to be fetched from message files.
\r
141 > Output all addresses from the *To*, *Cc* and *Bcc*
\r
145 > - Print the count of how many times was the address
\r
146 > - encountered during search.
\r
148 > + Print the count of how many times was the address
\r
149 > + encountered during search.
\r
151 > - Note: With this option, addresses are printed only after
\r
152 > - the whole search is finished. This may take long time.
\r
153 > + Note: With this option, addresses are printed only after
\r
154 > + the whole search is finished (and in seemingly random
\r
155 > + order). This may take long time.
\r
157 > ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)
\r
158 > This option can be used to present results in either
\r
159 > @@ -63,7 +63,9 @@ Supported options for **address** include
\r
160 > By default, results will be displayed in reverse chronological
\r
161 > order, (that is, the newest results will be displayed first).
\r
163 > - This option has no effect when used with --output=count.
\r
164 > + This option affects the seemingly random output order when
\r
165 > + used with --output=count.
\r
167 I know what this means but it confused me at first. How about "When
\r
168 used with --output=count this option changes the output from one
\r
169 seemingly random order to a different seemingly random order"?
\r
177 > ``--exclude=(true|false)``
\r
178 > A message is called "excluded" if it matches at least one tag in
\r
179 > @@ -95,4 +97,4 @@ SEE ALSO
\r
180 > **notmuch-dump(1)**, **notmuch-hooks(5)**, **notmuch-insert(1)**,
\r
181 > **notmuch-new(1)**, **notmuch-reply(1)**, **notmuch-restore(1)**,
\r
182 > **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**,
\r
183 > -***notmuch-search(1)**
\r
184 > +**notmuch-search(1)**
\r
185 > diff --git a/notmuch-search.c b/notmuch-search.c
\r
186 > index 5036d8e44005..14b9f01c5ad1 100644
\r
187 > --- a/notmuch-search.c
\r
188 > +++ b/notmuch-search.c
\r
189 > @@ -735,8 +735,8 @@ notmuch_address_command (notmuch_config_t *config, int argc, char *argv[])
\r
190 > if (opt_index < 0)
\r
191 > return EXIT_FAILURE;
\r
193 > - if (! ctx->output)
\r
194 > - ctx->output = OUTPUT_SENDER | OUTPUT_RECIPIENTS;
\r
195 > + if (! (ctx->output & (OUTPUT_SENDER | OUTPUT_RECIPIENTS)))
\r
196 > + ctx->output |= OUTPUT_SENDER;
\r
198 > if (_notmuch_search_prepare (ctx, config,
\r
199 > argc - opt_index, argv + opt_index))
\r
200 > diff --git a/test/T095-address.sh b/test/T095-address.sh
\r
201 > index 033d0f4fd68c..ed0cac7807ff 100755
\r
202 > --- a/test/T095-address.sh
\r
203 > +++ b/test/T095-address.sh
\r
204 > @@ -27,6 +27,11 @@ Mikhail Gusarov <dottedmag@dottedmag.net>
\r
206 > test_expect_equal_file OUTPUT EXPECTED
\r
208 > +test_begin_subtest "without --output"
\r
209 > +notmuch address '*' >OUTPUT
\r
210 > +# Use EXPECTED from previous subtest
\r
211 > +test_expect_equal_file OUTPUT EXPECTED
\r
213 > test_begin_subtest "--output=sender --format=json"
\r
214 > notmuch address --output=sender --format=json '*' >OUTPUT
\r
215 > cat <<EOF >EXPECTED
\r
216 > @@ -91,11 +96,6 @@ Mikhail Gusarov <dottedmag@dottedmag.net>
\r
218 > test_expect_equal_file OUTPUT EXPECTED
\r
220 > -test_begin_subtest "without --output"
\r
221 > -notmuch address '*' >OUTPUT
\r
222 > -# Use EXPECTED from previous subtest
\r
223 > -test_expect_equal_file OUTPUT EXPECTED
\r
225 > test_begin_subtest "--output=sender --output=count"
\r
226 > notmuch address --output=sender --output=count '*' | sort -n >OUTPUT
\r
227 > cat <<EOF >EXPECTED
\r
228 > @@ -119,10 +119,10 @@ cat <<EOF >EXPECTED
\r
230 > test_expect_equal_file OUTPUT EXPECTED
\r
232 > -test_begin_subtest "--output=sender --output=count --format=json"
\r
233 > +test_begin_subtest "--output=count --format=json"
\r
234 > # Since the iteration order of GHashTable is not specified, we
\r
235 > # preprocess and sort the results to keep the order stable here.
\r
236 > -notmuch address --output=sender --output=count --format=json '*' | \
\r
237 > +notmuch address --output=count --format=json '*' | \
\r
238 > sed -e 's/^\[//' -e 's/]$//' -e 's/,$//' | sort >OUTPUT
\r
239 > cat <<EOF >EXPECTED
\r
240 > {"name": "Adrian Perez de Castro", "address": "aperez@igalia.com", "name-addr": "Adrian Perez de Castro <aperez@igalia.com>", "count": 1}
\r
244 > _______________________________________________
\r
245 > notmuch mailing list
\r
246 > notmuch@notmuchmail.org
\r
247 > http://notmuchmail.org/mailman/listinfo/notmuch
\r