Re: Avoiding the "huge INBOX of death"
[notmuch-archives.git] / dc / 0d681202f902b251e73aa00f47ec3a4f27fc0a
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 arlo.cworth.org (Postfix) with ESMTP id A3C666DE0B2F\r
6  for <notmuch@notmuchmail.org>; Sat, 23 Jan 2016 04:49:42 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.309\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.309 tagged_above=-999 required=5 tests=[AWL=0.242,\r
12   RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id xQ0AP3w5HxVg for <notmuch@notmuchmail.org>;\r
16  Sat, 23 Jan 2016 04:49:40 -0800 (PST)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id C8AB16DE0217\r
19  for <notmuch@notmuchmail.org>; Sat, 23 Jan 2016 04:49:40 -0800 (PST)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1aMxcg-0007xW-TJ; Sat, 23 Jan 2016 07:48:58 -0500\r
23 Received: (nullmailer pid 7655 invoked by uid 1000);\r
24  Sat, 23 Jan 2016 12:49:35 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH] test: refactor directory name sanitization\r
28 Date: Sat, 23 Jan 2016 08:49:26 -0400\r
29 Message-Id: <1453553366-7454-1-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.6.4\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.20\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35  <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
37  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
42  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Sat, 23 Jan 2016 12:49:42 -0000\r
44 \r
45 test_C and notmuch_search_files_sanitize were giving different output on\r
46 the same path, which is not technically wrong, but slightly\r
47 confusing.\r
48 ---\r
49  test/T560-lib-error.sh |  2 +-\r
50  test/test-lib.sh       | 11 ++++++++---\r
51  2 files changed, 9 insertions(+), 4 deletions(-)\r
52 \r
53 diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh\r
54 index c280939..59a479c 100755\r
55 --- a/test/T560-lib-error.sh\r
56 +++ b/test/T560-lib-error.sh\r
57 @@ -183,7 +183,7 @@ int main (int argc, char** argv)\r
58  EOF\r
59  cat <<'EOF' >EXPECTED\r
60  == stdout ==\r
61 -Path already exists: CWD/mail\r
62 +Path already exists: MAIL_DIR\r
63  \r
64  == stderr ==\r
65  EOF\r
66 diff --git a/test/test-lib.sh b/test/test-lib.sh\r
67 index 0c9b366..c8f14d9 100644\r
68 --- a/test/test-lib.sh\r
69 +++ b/test/test-lib.sh\r
70 @@ -684,9 +684,14 @@ notmuch_search_sanitize ()\r
71      perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'\r
72  }\r
73  \r
74 -notmuch_search_files_sanitize()\r
75 +notmuch_search_files_sanitize ()\r
76  {\r
77 -    sed -e "s,$MAIL_DIR,MAIL_DIR,"\r
78 +    notmuch_dir_sanitize\r
79 +}\r
80 +\r
81 +notmuch_dir_sanitize ()\r
82 +{\r
83 +    sed -e  "s,$MAIL_DIR,MAIL_DIR," -e "s,${PWD},CWD,g" "$@"\r
84  }\r
85  \r
86  NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,'\r
87 @@ -1186,7 +1191,7 @@ test_C () {\r
88      echo "== stdout ==" > OUTPUT.stdout\r
89      echo "== stderr ==" > OUTPUT.stderr\r
90      ./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr\r
91 -    sed "s,${PWD},CWD,g"  OUTPUT.stdout OUTPUT.stderr > OUTPUT\r
92 +    notmuch_dir_sanitize  OUTPUT.stdout OUTPUT.stderr > OUTPUT\r
93  }\r
94  \r
95  \r
96 -- \r
97 2.6.4\r
98 \r