Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 20 / 82b59ab47450c3560e24eb6c83327b3f3fa536
1 Return-Path: <too@guru-group.fi>\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 1906D431FBF\r
6         for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 08:31:07 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 2.438\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
12         tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 yajM-yjnMyKD for <notmuch@notmuchmail.org>;\r
16         Sun, 29 Mar 2015 08:31:03 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id C0A38431FAE\r
19         for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 08:31:03 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 1C4C510009D; Sun, 29 Mar 2015 18:30:38 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] test/thread-order: more robust loop exit in case of broken\r
25         input\r
26 Date: Sun, 29 Mar 2015 18:30:36 +0300\r
27 Message-Id: <1427643036-7171-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 2.0.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Sun, 29 Mar 2015 15:31:07 -0000\r
43 \r
44 When creating $THREADS data it may end of not having 'None' at all\r
45 or the numbers in line output yields a loop.\r
46 \r
47 To avoid loop the value in current array index is set to 'None'\r
48 so that if the same item is reached again the loop will end.\r
49 \r
50 Also empty string as next array index will end the loop.\r
51 ---\r
52 \r
53 This is v2 of id:1427310460-15801-1-git-send-email-tomi.ollila@iki.fi\r
54 \r
55 Tested loop termination by setting THREADS='0 0 0 0'\r
56 \r
57 \r
58  test/T260-thread-order.sh | 5 ++++-\r
59  1 file changed, 4 insertions(+), 1 deletion(-)\r
60 \r
61 diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh\r
62 index 99f5833..5239bd4 100755\r
63 --- a/test/T260-thread-order.sh\r
64 +++ b/test/T260-thread-order.sh\r
65 @@ -45,9 +45,12 @@ for ((n = 0; n < 4; n++)); do\r
66      while read -a parents; do\r
67          references=""\r
68          parent=${parents[$n]}\r
69 -        while [[ $parent != None ]]; do\r
70 +        while [[ ${parent:-None} != None ]]; do\r
71              references="<m$parent@t$thread> $references"\r
72 +            pp=$parent\r
73              parent=${parents[$parent]}\r
74 +            # Avoid looping over broken input (if ever)\r
75 +            parents[$pp]="None"\r
76          done\r
77  \r
78          generate_message \\r
79 -- \r
80 2.1.0\r
81 \r