Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 6f / 5b0d93844b735e55222d2e12095171174489e9
1 Return-Path: <jani@nikula.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 EB273431FD6\r
6         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 13:41:01 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 AFtJYEo8V-XN for <notmuch@notmuchmail.org>;\r
16         Sun, 23 Feb 2014 13:40:55 -0800 (PST)\r
17 Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com\r
18  [74.125.83.50])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  78F94431FCF    for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 13:40:55 -0800\r
21  (PST)\r
22 Received: by mail-ee0-f50.google.com with SMTP id d17so2802557eek.9\r
23         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 13:40:52 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
27         :references;\r
28         bh=3kRBxEHl0fbxx2T0N5Ir/ommIVcUgRGFfaKCuMUy+tQ=;\r
29         b=c/SkuS9WVSweTB3O6qTPC62dC51CzTd0hKgtn1Kv23Cipd8XY0frqnyJn82RLeS2xb\r
30         dh5XqM8N7ocqyzUlEx3PJ3kVbaqoIfwSOqMGLJCWFYGc7BDoVPiw1oEoeq7lhEoJSLsL\r
31         boRlhltPIc+vVxqP8B23lIwaYamrlq4YWPFM7aP8rNt76ZgqzjtWWX9vptXca0vEaVtd\r
32         1xUb3loWYW38wZeHc8SnLmDdMo3NU99ynuwKzfki9QSRnYKQM4KyaqVgcvnfxeqtS7ng\r
33         eVo1ymfNK6q5nggcVTT+mxkXSKyOKlbfbZSqBPHxBYbFjOmWn5UaVC9SJUvj2oMlHSVm\r
34         WEcQ==\r
35 X-Gm-Message-State:\r
36  ALoCoQnDKoQqKRN/hyOnRBH6mwGO9N+ph+m1EUiMxdM42qErm7aeonQBsBySIht07xkVoXCYhkRC\r
37 X-Received: by 10.15.21.2 with SMTP id c2mr20941297eeu.77.1393191652739;\r
38         Sun, 23 Feb 2014 13:40:52 -0800 (PST)\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
40         [88.195.111.91])\r
41         by mx.google.com with ESMTPSA id q44sm55731714eez.1.2014.02.23.13.40.51\r
42         for <multiple recipients>\r
43         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
44         Sun, 23 Feb 2014 13:40:51 -0800 (PST)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: notmuch@notmuchmail.org,\r
47         Mark Walters <markwalters1009@gmail.com>\r
48 Subject: [PATCH] test: test folder renames\r
49 Date: Sun, 23 Feb 2014 23:40:50 +0200\r
50 Message-Id: <1393191650-28333-1-git-send-email-jani@nikula.org>\r
51 X-Mailer: git-send-email 1.8.5.3\r
52 In-Reply-To: <87siray6th.fsf@qmul.ac.uk>\r
53 References: <87siray6th.fsf@qmul.ac.uk>\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Sun, 23 Feb 2014 21:41:02 -0000\r
67 \r
68 On Sun, 23 Feb 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
69 > I was experimenting with letting notmuch new take an argument to tell it\r
70 > to scan only a particular directory (and sub-directories) for new\r
71 > messages. I came across the following strange behaviour which is also\r
72 > present in master (with a fresh database)\r
73 >\r
74 > I have a bunch of maildirs in /home/mail: so folders .mail.foo/\r
75 > .mail.bar/ each of which has cur/new/tmp and all the messages are in\r
76 > cur.\r
77 >\r
78 > If I do mv .mail.foo .mail.bar/ and run notmuch new I get the expected\r
79 > lots of renames (900 or so in the case I was trying). But if I then do\r
80 > mv .mail.bar/.mail.foo . and run notmuch new almost all the messages get\r
81 > removed (but 30 renames do get detected). If I then do touch .mail.foo/*\r
82 > the messages get found again\r
83 >\r
84 > I am guessing the 30 renames might be because those 30 have duplicates\r
85 > somewhere else.\r
86 >\r
87 > But the other behaviour has me puzzled.\r
88 \r
89 This test reproduces the problem for me, but it's not\r
90 deterministic. With the loop, I get roughly one fail per test run:\r
91 \r
92  FAIL   Rename folder back\r
93  --- T051-new-renames.27.expected       2014-02-23 21:37:10.121774241 +0000\r
94  +++ T051-new-renames.27.output         2014-02-23 21:37:10.121774241 +0000\r
95  @@ -1 +1 @@\r
96  -No new mail. Detected 10 file renames.\r
97  +No new mail. Removed 10 messages.\r
98  FAIL   Files remain the same\r
99  --- T051-new-renames.28.expected       2014-02-23 21:37:10.133774652 +0000\r
100  +++ T051-new-renames.28.output         2014-02-23 21:37:10.133774652 +0000\r
101  @@ -1,13 +1,3 @@\r
102  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-121\r
103  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-122\r
104  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-123\r
105  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-124\r
106  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-125\r
107  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-126\r
108  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-127\r
109  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-128\r
110  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-129\r
111  -/path/to/test/tmp.T051-new-renames/mail/foo/msg-130\r
112   /path/to/test/tmp.T051-new-renames/mail/bar/msg-131\r
113   /path/to/test/tmp.T051-new-renames/mail/bar/msg-132\r
114   /path/to/test/tmp.T051-new-renames/mail/bar/msg-133\r
115 \r
116 I'm as puzzled as you are.\r
117 \r
118 BR,\r
119 Jani.\r
120 ---\r
121  test/T051-new-renames.sh | 40 ++++++++++++++++++++++++++++++++++++++++\r
122  1 file changed, 40 insertions(+)\r
123  create mode 100755 test/T051-new-renames.sh\r
124 \r
125 diff --git a/test/T051-new-renames.sh b/test/T051-new-renames.sh\r
126 new file mode 100755\r
127 index 000000000000..febe006f5888\r
128 --- /dev/null\r
129 +++ b/test/T051-new-renames.sh\r
130 @@ -0,0 +1,40 @@\r
131 +#!/usr/bin/env bash\r
132 +test_description='"notmuch new" with directory renames'\r
133 +. ./test-lib.sh\r
134 +\r
135 +for loop in `seq 10`; do\r
136 +\r
137 +rm -rf ${MAIL_DIR}\r
138 +\r
139 +for i in `seq 10`; do\r
140 +    generate_message '[dir]=foo' '[subject]="Message foo $i"'\r
141 +done\r
142 +\r
143 +for i in `seq 10`; do\r
144 +    generate_message '[dir]=bar' '[subject]="Message bar $i"'\r
145 +done\r
146 +\r
147 +test_begin_subtest "Index the messages, round $loop"\r
148 +output=$(NOTMUCH_NEW)\r
149 +test_expect_equal "$output" "Added 20 new messages to the database."\r
150 +\r
151 +all_files=$(notmuch search --output=files \*)\r
152 +count_foo=$(notmuch count folder:foo)\r
153 +\r
154 +test_begin_subtest "Rename folder"\r
155 +mv ${MAIL_DIR}/foo ${MAIL_DIR}/baz\r
156 +output=$(NOTMUCH_NEW)\r
157 +test_expect_equal "$output" "No new mail. Detected $count_foo file renames."\r
158 +\r
159 +test_begin_subtest "Rename folder back"\r
160 +mv ${MAIL_DIR}/baz ${MAIL_DIR}/foo\r
161 +output=$(NOTMUCH_NEW)\r
162 +test_expect_equal "$output" "No new mail. Detected $count_foo file renames."\r
163 +\r
164 +test_begin_subtest "Files remain the same"\r
165 +output=$(notmuch search --output=files \*)\r
166 +test_expect_equal "$output" "$all_files"\r
167 +\r
168 +done\r
169 +\r
170 +test_done\r
171 -- \r
172 1.8.5.3\r
173 \r