1 Return-Path: <cworth@cworth.org>
\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 49304429E20
\r
6 for <notmuch@notmuchmail.org>; Mon, 24 Jan 2011 22:39:29 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1 tagged_above=-999 required=5
\r
12 tests=[ALL_TRUSTED=-1] 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 Ba5CEj8Omrf6; Mon, 24 Jan 2011 22:39:27 -0800 (PST)
\r
16 Received: from yoom.amr.corp.intel.com (localhost [127.0.0.1])
\r
17 by olra.theworths.org (Postfix) with ESMTP id D9CA0431FB6;
\r
18 Mon, 24 Jan 2011 22:39:25 -0800 (PST)
\r
19 From: Carl Worth <cworth@cworth.org>
\r
20 To: notmuch@notmuchmail.org
\r
21 Subject: [PATCH] Add --include-duplicates option to a couple of commands.
\r
22 Date: Tue, 25 Jan 2011 16:39:24 +1000
\r
23 Message-Id: <1295937564-2518-1-git-send-email-cworth@cworth.org>
\r
24 X-Mailer: git-send-email 1.7.2.3
\r
26 Content-Type: text/plain; charset=UTF-8
\r
27 Content-Transfer-Encoding: 8bit
\r
28 X-BeenThere: notmuch@notmuchmail.org
\r
29 X-Mailman-Version: 2.1.13
\r
31 List-Id: "Use and development of the notmuch mail system."
\r
32 <notmuch.notmuchmail.org>
\r
33 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
34 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
35 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
36 List-Post: <mailto:notmuch@notmuchmail.org>
\r
37 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
38 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
40 X-List-Received-Date: Tue, 25 Jan 2011 06:39:29 -0000
\r
42 This adds new functionality under the names of:
\r
44 notmuch search --output=files --include-duplicates
\r
45 notmuch show --include-duplicates
\r
46 notmuch show --format=json --include-duplicates
\r
48 These new commands behave similarly to the existing commands without
\r
49 the --include-duplicates agument. The difference is that with the new
\r
50 argument any duplicate mail files will be included in the
\r
51 output. Here, files are considered duplicates if they contain
\r
52 identical contents for the Message-Id header, (regardless of any other
\r
53 differences in the content of the file). Without the
\r
54 --include-duplicates argument, these commands would emit a single,
\r
55 arbitrary file in the face of duplicates.
\r
57 WARNING: This commit is not yet ready to be pushed to the notmuch
\r
58 repository. There are at least two problems with the commit so far:
\r
60 1. Nothing has been documented yet.
\r
62 Fixing this shouldn't be too hard. It's mostly just taking
\r
63 the text from above and shoving it into the
\r
64 documentation. I can do this easily enough myself.
\r
66 2. show --format=json --include-duplicates doesn't work yet
\r
68 This is a more serious problem. I believe the JSON output
\r
69 with this patch is not correct and will likely break a
\r
70 client trying to consume it. It inserts the duplicate
\r
71 message into an array next to the existing message. Our
\r
72 current JSON schema isn't documented formally that I could
\r
73 find, except for a comment in the emacs code that consumes
\r
76 A thread is a forest or list of trees. A tree is a two
\r
77 element list where the first element is a message, and
\r
78 the second element is a possibly empty forest of
\r
81 I believe this commit breaks the "two-element list"
\r
82 expectation. What we would want instead is the duplicate
\r
83 message to appear as a peer next to the original message,
\r
84 (and then perhaps have replies appear only to one of the
\r
87 My current need for --include-duplicates was recently satisfied, so I
\r
88 won't likely pursue this further for now. But I wanted to put this
\r
89 code out rather than losing it.
\r
91 If someone wants to fix the patch to do the "right thing" with the
\r
92 JSON output, then that would be great.
\r
94 ALSO NOTE: I left the
\r
95 json.expected-output/notmuch-show-thread-format-json-maildir-storage
\r
96 out of this commit. It has lines in it that are too long to be sent
\r
99 notmuch-search.c | 30 +++++-
\r
100 notmuch-show.c | 61 +++++++++--
\r
102 test/json | 33 ++++++-
\r
103 ...-show-thread-include-duplicates-maildir-storage | 94 ++++++++++++++++
\r
104 .../notmuch-show-thread-maildir-storage | 47 ++++++++
\r
105 test/search-output | 113 ++++++++++++++++++++
\r
106 7 files changed, 361 insertions(+), 19 deletions(-)
\r
107 create mode 100644 test/json.expected-output/notmuch-show-thread-include-duplicates-maildir-storage
\r
108 create mode 100644 test/json.expected-output/notmuch-show-thread-maildir-storage
\r
110 diff --git a/notmuch-search.c b/notmuch-search.c
\r
111 index c628b36..6d032c2 100644
\r
112 --- a/notmuch-search.c
\r
113 +++ b/notmuch-search.c
\r
114 @@ -247,7 +247,8 @@ static int
\r
115 do_search_messages (const void *ctx,
\r
116 const search_format_t *format,
\r
117 notmuch_query_t *query,
\r
120 + notmuch_bool_t include_duplicates)
\r
122 notmuch_message_t *message;
\r
123 notmuch_messages_t *messages;
\r
124 @@ -269,8 +270,25 @@ do_search_messages (const void *ctx,
\r
125 fputs (format->item_sep, stdout);
\r
127 if (output == OUTPUT_FILES) {
\r
128 - format->item_id (ctx, "",
\r
129 - notmuch_message_get_filename (message));
\r
130 + if (include_duplicates) {
\r
131 + notmuch_filenames_t *filenames;
\r
132 + int first_filename = 1;
\r
134 + for (filenames = notmuch_message_get_filenames (message);
\r
135 + notmuch_filenames_valid (filenames);
\r
136 + notmuch_filenames_move_to_next (filenames))
\r
138 + if (! first_filename)
\r
139 + fputs (format->item_sep, stdout);
\r
140 + first_filename = 0;
\r
142 + format->item_id (ctx, "",
\r
143 + notmuch_filenames_get (filenames));
\r
146 + format->item_id (ctx, "",
\r
147 + notmuch_message_get_filename (message));
\r
149 } else { /* output == OUTPUT_MESSAGES */
\r
150 format->item_id (ctx, "id:",
\r
151 notmuch_message_get_message_id (message));
\r
152 @@ -352,6 +370,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
153 const search_format_t *format = &format_text;
\r
155 output_t output = OUTPUT_SUMMARY;
\r
156 + notmuch_bool_t include_duplicates = 0;
\r
158 for (i = 0; i < argc && argv[i][0] == '-'; i++) {
\r
159 if (strcmp (argv[i], "--") == 0) {
\r
160 @@ -394,6 +413,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
161 fprintf (stderr, "Invalid value for --output: %s\n", opt);
\r
164 + } else if (STRNCMP_LITERAL (argv[i], "--include-duplicates") == 0) {
\r
165 + include_duplicates = 1;
\r
167 fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
\r
169 @@ -438,7 +459,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
171 case OUTPUT_MESSAGES:
\r
173 - ret = do_search_messages (ctx, format, query, output);
\r
174 + ret = do_search_messages (ctx, format, query, output,
\r
175 + include_duplicates);
\r
178 ret = do_search_tags (ctx, notmuch, format, query);
\r
179 diff --git a/notmuch-show.c b/notmuch-show.c
\r
180 index ef421ec..3fbbeac 100644
\r
181 --- a/notmuch-show.c
\r
182 +++ b/notmuch-show.c
\r
183 @@ -463,7 +463,11 @@ format_part_json (GMimeObject *part, int *part_count)
\r
187 -show_message (void *ctx, const show_format_t *format, notmuch_message_t *message, int indent)
\r
188 +show_message (void *ctx,
\r
189 + const show_format_t *format,
\r
190 + notmuch_message_t *message,
\r
191 + const char *filename,
\r
194 fputs (format->message_start, stdout);
\r
195 if (format->message)
\r
196 @@ -476,18 +480,22 @@ show_message (void *ctx, const show_format_t *format, notmuch_message_t *message
\r
198 fputs (format->body_start, stdout);
\r
200 - show_message_body (notmuch_message_get_filename (message), format->part);
\r
201 + show_message_body (filename, format->part);
\r
202 fputs (format->body_end, stdout);
\r
204 fputs (format->message_end, stdout);
\r
209 -show_messages (void *ctx, const show_format_t *format, notmuch_messages_t *messages, int indent,
\r
210 - notmuch_bool_t entire_thread)
\r
211 +show_messages (void *ctx,
\r
212 + const show_format_t *format,
\r
213 + notmuch_messages_t *messages,
\r
215 + notmuch_bool_t entire_thread,
\r
216 + notmuch_bool_t include_duplicates)
\r
218 notmuch_message_t *message;
\r
219 + const char *filename;
\r
220 notmuch_bool_t match;
\r
223 @@ -498,7 +506,7 @@ show_messages (void *ctx, const show_format_t *format, notmuch_messages_t *messa
\r
224 notmuch_messages_valid (messages);
\r
225 notmuch_messages_move_to_next (messages))
\r
229 fputs (format->message_set_sep, stdout);
\r
232 @@ -511,14 +519,38 @@ show_messages (void *ctx, const show_format_t *format, notmuch_messages_t *messa
\r
233 next_indent = indent;
\r
235 if (match || entire_thread) {
\r
236 - show_message (ctx, format, message, indent);
\r
238 + if (include_duplicates) {
\r
239 + notmuch_filenames_t *filenames;
\r
240 + int first_filename = 1;
\r
242 + for (filenames = notmuch_message_get_filenames (message);
\r
243 + notmuch_filenames_valid (filenames);
\r
244 + notmuch_filenames_move_to_next (filenames))
\r
246 + if (! first_filename) {
\r
247 + fputs (format->message_set_end, stdout);
\r
248 + fputs (format->message_set_sep, stdout);
\r
249 + fputs (format->message_set_start, stdout);
\r
251 + first_filename = 0;
\r
253 + filename = notmuch_filenames_get (filenames);
\r
255 + show_message (ctx, format, message, filename, indent);
\r
258 + filename = notmuch_message_get_filename (message);
\r
259 + show_message (ctx, format, message, filename, indent);
\r
262 next_indent = indent + 1;
\r
264 fputs (format->message_set_sep, stdout);
\r
267 show_messages (ctx, format, notmuch_message_get_replies (message),
\r
268 - next_indent, entire_thread);
\r
269 + next_indent, entire_thread, include_duplicates);
\r
271 notmuch_message_destroy (message);
\r
273 @@ -579,7 +611,8 @@ static int
\r
274 do_show (void *ctx,
\r
275 notmuch_query_t *query,
\r
276 const show_format_t *format,
\r
277 - int entire_thread)
\r
278 + notmuch_bool_t entire_thread,
\r
279 + notmuch_bool_t include_duplicates)
\r
281 notmuch_threads_t *threads;
\r
282 notmuch_thread_t *thread;
\r
283 @@ -604,7 +637,8 @@ do_show (void *ctx,
\r
284 fputs (format->message_set_sep, stdout);
\r
285 first_toplevel = 0;
\r
287 - show_messages (ctx, format, messages, 0, entire_thread);
\r
288 + show_messages (ctx, format, messages, 0,
\r
289 + entire_thread, include_duplicates);
\r
291 notmuch_thread_destroy (thread);
\r
293 @@ -624,7 +658,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
294 char *query_string;
\r
296 const show_format_t *format = &format_text;
\r
297 - int entire_thread = 0;
\r
298 + notmuch_bool_t entire_thread = 0;
\r
299 + notmuch_bool_t include_duplicates = 0;
\r
303 @@ -650,6 +685,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
305 } else if (STRNCMP_LITERAL (argv[i], "--entire-thread") == 0) {
\r
307 + } else if (STRNCMP_LITERAL (argv[i], "--include-duplicates") == 0) {
\r
308 + include_duplicates = 1;
\r
310 fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
\r
312 @@ -688,7 +725,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
314 return do_show_raw (ctx, query);
\r
316 - return do_show (ctx, query, format, entire_thread);
\r
317 + return do_show (ctx, query, format, entire_thread, include_duplicates);
\r
319 notmuch_query_destroy (query);
\r
320 notmuch_database_close (notmuch);
\r
321 diff --git a/test/basic b/test/basic
\r
322 index e1269e2..a8e2dd7 100755
\r
325 @@ -52,7 +52,7 @@ test_expect_code 2 'failure to clean up causes the test to fail' '
\r
326 # Ensure that all tests are being run
\r
327 test_begin_subtest 'Ensure that all available tests will be run by notmuch-test'
\r
328 tests_in_suite=$(grep TESTS= ../notmuch-test | sed -e "s/TESTS=\"\(.*\)\"/\1/" | tr " " "\n" | sort)
\r
329 -available=$(ls -1 ../ | grep -v -E "^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test|README|test-lib.sh|test-results|tmp.*|valgrind|corpus*|emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|test.expected-output|.*~)" | sort)
\r
330 +available=$(ls -1 ../ | grep -v -E "^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test|README|test-lib.sh|test-results|tmp.*|valgrind|corpus*|emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|.*.expected-output|.*~)" | sort)
\r
331 test_expect_equal "$tests_in_suite" "$available"
\r
333 EXPECTED=../test.expected-output
\r
334 diff --git a/test/json b/test/json
\r
335 index 7fe2a27..f2349cc 100755
\r
339 test_description="--format=json output"
\r
342 -test_begin_subtest "Show message: json"
\r
343 +EXPECTED=../json.expected-output
\r
347 +# Setup a duplicate message for testing
\r
348 +cp "$MAIL_DIR/cur/03:2," "$MAIL_DIR/cur/03:2-duplicate,"
\r
349 +increment_mtime "$MAIL_DIR/cur"
\r
350 +notmuch new >/dev/null
\r
352 +test_begin_subtest "Show single message: --format=json"
\r
353 add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\""
\r
354 output=$(notmuch show --format=json "json-show-message")
\r
355 test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Cc\": \"\", \"Bcc\": \"\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 -0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"
\r
357 -test_begin_subtest "Search message: json"
\r
358 +test_begin_subtest "Search single message: --format=json"
\r
359 add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""
\r
360 output=$(notmuch search --format=json "json-search-message" | notmuch_search_sanitize)
\r
361 test_expect_equal "$output" "[{\"thread\": \"XXX\",
\r
362 @@ -18,6 +27,26 @@ test_expect_equal "$output" "[{\"thread\": \"XXX\",
\r
363 \"subject\": \"json-search-subject\",
\r
364 \"tags\": [\"inbox\", \"unread\"]}]"
\r
366 +test_begin_subtest "Show thread:"
\r
367 +output=$(notmuch show id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
368 +expected=$(cat $EXPECTED/notmuch-show-thread-maildir-storage)
\r
369 +test_expect_equal "$output" "$expected"
\r
371 +test_begin_subtest "Show thread: --include-duplicates"
\r
372 +output=$(notmuch show --include-duplicates id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
373 +expected=$(cat $EXPECTED/notmuch-show-thread-include-duplicates-maildir-storage)
\r
374 +test_expect_equal "$output" "$expected"
\r
376 +test_begin_subtest "Show thread: --format=json"
\r
377 +output=$(notmuch show --format=json id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
378 +expected=$(cat $EXPECTED/notmuch-show-thread-format-json-maildir-storage)
\r
379 +test_expect_equal "$output" "$expected"
\r
381 +test_begin_subtest "Show thread: --format=json --include-duplicates"
\r
382 +output=$(notmuch show --format=json --include-duplicates id:20091117190054.GU3165@dottiness.seas.harvard.edu)
\r
383 +expected=$(cat $EXPECTED/notmuch-show-thread-format-json-include-duplicates-maildir-storage)
\r
384 +test_expect_equal "$output" "$expected"
\r
386 test_begin_subtest "Search by subject (utf-8):"
\r
387 add_message [subject]=utf8-sübjéct "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\""
\r
388 output=$(notmuch search subject:utf8-sübjéct | notmuch_search_sanitize)
\r
389 diff --git a/test/json.expected-output/notmuch-show-thread-include-duplicates-maildir-storage b/test/json.expected-output/notmuch-show-thread-include-duplicates-maildir-storage
\r
390 new file mode 100644
\r
391 index 0000000..d6e8816
\r
393 +++ b/test/json.expected-output/notmuch-show-thread-include-duplicates-maildir-storage
\r
396 message{ id:20091117190054.GU3165@dottiness.seas.harvard.edu depth:0 match:1 filename:/home/cworth/src/notmuch/test/tmp.json/mail/cur/03:2,
\r
399 +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox unread)
\r
400 +Subject: [notmuch] Working with Maildir storage?
\r
401 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
402 +To: notmuch@notmuchmail.org
\r
403 +Date: Tue, 17 Nov 2009 14:00:54 -0500
\r
409 part{ ID: 1, Content-type: text/plain
\r
410 +I saw the LWN article and decided to take a look at notmuch. I'm
\r
411 +currently using mutt and mairix to index and read a collection of
\r
412 +Maildir mail folders (around 40,000 messages total).
\r
414 +notmuch indexed the messages without complaint, but my attempt at
\r
415 +searching bombed out. Running, for example:
\r
417 + notmuch search storage
\r
419 +Resulted in 4604 lines of errors along the lines of:
\r
422 + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
\r
423 + Too many open files
\r
425 +I'm curious if this is expected behavior (i.e., notmuch does not work
\r
426 +with Maildir) or if something else is going on.
\r
431 +Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
432 +Senior Technologist, Computing and Information Technology
\r
433 +Harvard University School of Engineering and Applied Sciences
\r
438 part{ ID: 2, Content-type: application/pgp-signature
\r
439 +Non-text part: application/pgp-signature
\r
443 part{ ID: 3, Content-type: text/plain
\r
444 +_______________________________________________
\r
445 +notmuch mailing list
\r
446 +notmuch@notmuchmail.org
\r
447 +http://notmuchmail.org/mailman/listinfo/notmuch
\r
455 message{ id:20091117190054.GU3165@dottiness.seas.harvard.edu depth:0 match:1 filename:/home/cworth/src/notmuch/test/tmp.json/mail/cur/03:2,
\r
458 +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox unread)
\r
459 +Subject: [notmuch] Working with Maildir storage?
\r
460 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
461 +To: notmuch@notmuchmail.org
\r
462 +Date: Tue, 17 Nov 2009 14:00:54 -0500
\r
468 part{ ID: 1, Content-type: text/plain
\r
469 +I saw the LWN article and decided to take a look at notmuch. I'm
\r
470 +currently using mutt and mairix to index and read a collection of
\r
471 +Maildir mail folders (around 40,000 messages total).
\r
473 +notmuch indexed the messages without complaint, but my attempt at
\r
474 +searching bombed out. Running, for example:
\r
476 + notmuch search storage
\r
478 +Resulted in 4604 lines of errors along the lines of:
\r
481 + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
\r
482 + Too many open files
\r
484 +I'm curious if this is expected behavior (i.e., notmuch does not work
\r
485 +with Maildir) or if something else is going on.
\r
490 +Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
491 +Senior Technologist, Computing and Information Technology
\r
492 +Harvard University School of Engineering and Applied Sciences
\r
497 part{ ID: 2, Content-type: application/pgp-signature
\r
498 +Non-text part: application/pgp-signature
\r
502 part{ ID: 3, Content-type: text/plain
\r
503 +_______________________________________________
\r
504 +notmuch mailing list
\r
505 +notmuch@notmuchmail.org
\r
506 +http://notmuchmail.org/mailman/listinfo/notmuch
\r
513 diff --git a/test/json.expected-output/notmuch-show-thread-maildir-storage b/test/json.expected-output/notmuch-show-thread-maildir-storage
\r
514 new file mode 100644
\r
515 index 0000000..77fefa8
\r
517 +++ b/test/json.expected-output/notmuch-show-thread-maildir-storage
\r
520 message{ id:20091117190054.GU3165@dottiness.seas.harvard.edu depth:0 match:1 filename:/home/cworth/src/notmuch/test/tmp.json/mail/cur/03:2,
\r
523 +Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox unread)
\r
524 +Subject: [notmuch] Working with Maildir storage?
\r
525 +From: Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
526 +To: notmuch@notmuchmail.org
\r
527 +Date: Tue, 17 Nov 2009 14:00:54 -0500
\r
533 part{ ID: 1, Content-type: text/plain
\r
534 +I saw the LWN article and decided to take a look at notmuch. I'm
\r
535 +currently using mutt and mairix to index and read a collection of
\r
536 +Maildir mail folders (around 40,000 messages total).
\r
538 +notmuch indexed the messages without complaint, but my attempt at
\r
539 +searching bombed out. Running, for example:
\r
541 + notmuch search storage
\r
543 +Resulted in 4604 lines of errors along the lines of:
\r
546 + /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
\r
547 + Too many open files
\r
549 +I'm curious if this is expected behavior (i.e., notmuch does not work
\r
550 +with Maildir) or if something else is going on.
\r
555 +Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
556 +Senior Technologist, Computing and Information Technology
\r
557 +Harvard University School of Engineering and Applied Sciences
\r
562 part{ ID: 2, Content-type: application/pgp-signature
\r
563 +Non-text part: application/pgp-signature
\r
567 part{ ID: 3, Content-type: text/plain
\r
568 +_______________________________________________
\r
569 +notmuch mailing list
\r
570 +notmuch@notmuchmail.org
\r
571 +http://notmuchmail.org/mailman/listinfo/notmuch
\r
578 diff --git a/test/search-output b/test/search-output
\r
579 index b414993..69d4c89 100755
\r
580 --- a/test/search-output
\r
581 +++ b/test/search-output
\r
582 @@ -4,6 +4,11 @@ test_description='various settings for "notmuch search --output="'
\r
586 +# Setup a duplicate message for testing
\r
587 +cp "$MAIL_DIR/cur/01:2," "$MAIL_DIR/cur/01:2-duplicate,"
\r
588 +increment_mtime "$MAIL_DIR/cur"
\r
589 +notmuch new >/dev/null
\r
591 test_begin_subtest "notmuch search --output=threads"
\r
592 output=$(notmuch search --output=threads '*' | sed -e s/thread:.*/thread:THREADID/)
\r
593 test_expect_equal "$output" "thread:THREADID
\r
594 @@ -213,6 +218,60 @@ MAIL_DIR/cur/07:2,
\r
596 MAIL_DIR/cur/01:2,"
\r
598 +test_begin_subtest "notmuch search --output=files --include-duplicates"
\r
599 +output=$(notmuch search --output=files --include-duplicates '*' | sed -e "s,$MAIL_DIR,MAIL_DIR,")
\r
600 +test_expect_equal "$output" "MAIL_DIR/cur/50:2,
\r
601 +MAIL_DIR/cur/49:2,
\r
602 +MAIL_DIR/cur/48:2,
\r
603 +MAIL_DIR/cur/47:2,
\r
604 +MAIL_DIR/cur/46:2,
\r
605 +MAIL_DIR/cur/45:2,
\r
606 +MAIL_DIR/cur/44:2,
\r
607 +MAIL_DIR/cur/43:2,
\r
608 +MAIL_DIR/cur/42:2,
\r
609 +MAIL_DIR/cur/41:2,
\r
610 +MAIL_DIR/cur/40:2,
\r
611 +MAIL_DIR/cur/39:2,
\r
612 +MAIL_DIR/cur/38:2,
\r
613 +MAIL_DIR/cur/37:2,
\r
614 +MAIL_DIR/cur/36:2,
\r
615 +MAIL_DIR/cur/35:2,
\r
616 +MAIL_DIR/cur/34:2,
\r
617 +MAIL_DIR/cur/33:2,
\r
618 +MAIL_DIR/cur/32:2,
\r
619 +MAIL_DIR/cur/31:2,
\r
620 +MAIL_DIR/cur/30:2,
\r
621 +MAIL_DIR/cur/29:2,
\r
622 +MAIL_DIR/cur/28:2,
\r
623 +MAIL_DIR/cur/27:2,
\r
624 +MAIL_DIR/cur/26:2,
\r
625 +MAIL_DIR/cur/25:2,
\r
626 +MAIL_DIR/cur/24:2,
\r
627 +MAIL_DIR/cur/23:2,
\r
628 +MAIL_DIR/cur/22:2,
\r
629 +MAIL_DIR/cur/21:2,
\r
630 +MAIL_DIR/cur/19:2,
\r
631 +MAIL_DIR/cur/18:2,
\r
632 +MAIL_DIR/cur/20:2,
\r
633 +MAIL_DIR/cur/17:2,
\r
634 +MAIL_DIR/cur/16:2,
\r
635 +MAIL_DIR/cur/15:2,
\r
636 +MAIL_DIR/cur/14:2,
\r
637 +MAIL_DIR/cur/13:2,
\r
638 +MAIL_DIR/cur/12:2,
\r
639 +MAIL_DIR/cur/11:2,
\r
640 +MAIL_DIR/cur/10:2,
\r
641 +MAIL_DIR/cur/09:2,
\r
642 +MAIL_DIR/cur/08:2,
\r
643 +MAIL_DIR/cur/06:2,
\r
644 +MAIL_DIR/cur/05:2,
\r
645 +MAIL_DIR/cur/04:2,
\r
646 +MAIL_DIR/cur/03:2,
\r
647 +MAIL_DIR/cur/07:2,
\r
648 +MAIL_DIR/cur/02:2,
\r
649 +MAIL_DIR/cur/01:2,
\r
650 +MAIL_DIR/cur/01:2-duplicate,"
\r
652 test_begin_subtest "notmuch search --format=json --output=files"
\r
653 output=$(notmuch search --format=json --output=files '*' | sed -e "s,$MAIL_DIR,MAIL_DIR,")
\r
654 test_expect_equal "$output" '["MAIL_DIR/cur/50:2,",
\r
655 @@ -266,6 +325,60 @@ test_expect_equal "$output" '["MAIL_DIR/cur/50:2,",
\r
656 "MAIL_DIR/cur/02:2,",
\r
657 "MAIL_DIR/cur/01:2,"]'
\r
659 +test_begin_subtest "notmuch search --format=json --output=files --include-duplicates"
\r
660 +output=$(notmuch search --format=json --output=files --include-duplicates '*' | sed -e "s,$MAIL_DIR,MAIL_DIR,")
\r
661 +test_expect_equal "$output" '["MAIL_DIR/cur/50:2,",
\r
662 +"MAIL_DIR/cur/49:2,",
\r
663 +"MAIL_DIR/cur/48:2,",
\r
664 +"MAIL_DIR/cur/47:2,",
\r
665 +"MAIL_DIR/cur/46:2,",
\r
666 +"MAIL_DIR/cur/45:2,",
\r
667 +"MAIL_DIR/cur/44:2,",
\r
668 +"MAIL_DIR/cur/43:2,",
\r
669 +"MAIL_DIR/cur/42:2,",
\r
670 +"MAIL_DIR/cur/41:2,",
\r
671 +"MAIL_DIR/cur/40:2,",
\r
672 +"MAIL_DIR/cur/39:2,",
\r
673 +"MAIL_DIR/cur/38:2,",
\r
674 +"MAIL_DIR/cur/37:2,",
\r
675 +"MAIL_DIR/cur/36:2,",
\r
676 +"MAIL_DIR/cur/35:2,",
\r
677 +"MAIL_DIR/cur/34:2,",
\r
678 +"MAIL_DIR/cur/33:2,",
\r
679 +"MAIL_DIR/cur/32:2,",
\r
680 +"MAIL_DIR/cur/31:2,",
\r
681 +"MAIL_DIR/cur/30:2,",
\r
682 +"MAIL_DIR/cur/29:2,",
\r
683 +"MAIL_DIR/cur/28:2,",
\r
684 +"MAIL_DIR/cur/27:2,",
\r
685 +"MAIL_DIR/cur/26:2,",
\r
686 +"MAIL_DIR/cur/25:2,",
\r
687 +"MAIL_DIR/cur/24:2,",
\r
688 +"MAIL_DIR/cur/23:2,",
\r
689 +"MAIL_DIR/cur/22:2,",
\r
690 +"MAIL_DIR/cur/21:2,",
\r
691 +"MAIL_DIR/cur/19:2,",
\r
692 +"MAIL_DIR/cur/18:2,",
\r
693 +"MAIL_DIR/cur/20:2,",
\r
694 +"MAIL_DIR/cur/17:2,",
\r
695 +"MAIL_DIR/cur/16:2,",
\r
696 +"MAIL_DIR/cur/15:2,",
\r
697 +"MAIL_DIR/cur/14:2,",
\r
698 +"MAIL_DIR/cur/13:2,",
\r
699 +"MAIL_DIR/cur/12:2,",
\r
700 +"MAIL_DIR/cur/11:2,",
\r
701 +"MAIL_DIR/cur/10:2,",
\r
702 +"MAIL_DIR/cur/09:2,",
\r
703 +"MAIL_DIR/cur/08:2,",
\r
704 +"MAIL_DIR/cur/06:2,",
\r
705 +"MAIL_DIR/cur/05:2,",
\r
706 +"MAIL_DIR/cur/04:2,",
\r
707 +"MAIL_DIR/cur/03:2,",
\r
708 +"MAIL_DIR/cur/07:2,",
\r
709 +"MAIL_DIR/cur/02:2,",
\r
710 +"MAIL_DIR/cur/01:2,",
\r
711 +"MAIL_DIR/cur/01:2-duplicate,"]'
\r
713 test_begin_subtest "notmuch search --output=tags"
\r
714 output=$(notmuch search --output=tags '*')
\r
715 test_expect_equal "$output" "attachment
\r