Re: Avoiding the "huge INBOX of death"
[notmuch-archives.git] / ef / 3b7c4dfb320f13fdefbb882f6c253aa0ba25e4
1 Return-Path: <david@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 olra.theworths.org (Postfix) with ESMTP id D7056431FBC\r
6         for <notmuch@notmuchmail.org>; Mon,  7 Apr 2014 03:40:12 -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: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 YkiKpMzYtA-b for <notmuch@notmuchmail.org>;\r
16         Mon,  7 Apr 2014 03:40:08 -0700 (PDT)\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
18         [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 13324431FB6\r
21         for <notmuch@notmuchmail.org>; Mon,  7 Apr 2014 03:40:08 -0700 (PDT)\r
22 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
23         4.72) (envelope-from <david@tethera.net>)\r
24         id 1WX6wJ-0007XK-Rx; Mon, 07 Apr 2014 10:38:07 +0000\r
25 Received: (nullmailer pid 22010 invoked by uid 1000); Mon, 07 Apr 2014\r
26         10:37:48 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
29 Subject: Re: [PATCH] test: Test thread linking in all possible delivery orders\r
30 In-Reply-To: <1395608456-9673-1-git-send-email-amdragon@mit.edu>\r
31 References: <1395608456-9673-1-git-send-email-amdragon@mit.edu>\r
32 User-Agent: Notmuch/0.17+174~g4efbc9f (http://notmuchmail.org) Emacs/24.3.1\r
33         (x86_64-pc-linux-gnu)\r
34 Date: Mon, 07 Apr 2014 07:37:48 -0300\r
35 Message-ID: <87y4zhfmrn.fsf@maritornes.cs.unb.ca>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Mon, 07 Apr 2014 10:40:13 -0000\r
51 \r
52 Austin Clements <amdragon@MIT.EDU> writes:\r
53 > +THREADS=$(python -c '\r
54 > +def mkTrees(free, tree={}):\r
55 > +    if not free:\r
56 \r
57 I'm not sure if using not for an empty set is idiomatic python or not,\r
58 but it did confuse me a moment.\r
59 \r
60 > +        print(" ".join(map(str, [msg[1] for msg in sorted(tree.items())])))\r
61 > +        return\r
62 > +    # Attach each free message to each message in the tree (if there is\r
63 > +    # no tree, make the free message the root)\r
64 > +    for msg in sorted(free):\r
65 > +        parents = sorted(tree.keys()) if tree else ["none"]\r
66 > +        for parent in parents:\r
67 > +            ntree = tree.copy()\r
68 > +            ntree[msg] = parent\r
69 > +            mkTrees(free - set([msg]), ntree)\r
70 > +mkTrees(set(range(4)))')\r
71 \r
72 FWIW, it took me a while to understand this.  I might have twigged\r
73 faster if the initial comment said something like "via backtracking".\r
74 \r
75 > +output=$(notmuch search '*' | notmuch_search_sanitize)\r
76 \r
77 > +expected=$(for ((i = 0; i < $nthreads; i++)); do\r
78 > +        echo "thread:XXX   2001-01-05 [4/4] m3, m2, m1, m0; p$i (inbox unread)"\r
79 > +    done)\r
80 > +test_expect_equal "$output" "$expected"\r
81 \r
82 It seems to me this summary line depends on the default search order.\r
83 It might be worth specifying the search order in the "notmuch search"\r
84 command just to make it a bit more robust.\r
85 \r
86 d\r