Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 7e / 211d5cb43be411b2dc0b54f1c018ef644e32a6
1 Return-Path: <amdragon@mit.edu>\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 19B12431FCF\r
6         for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:10:19 -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.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 ApxhGS3X9hyG for <notmuch@notmuchmail.org>;\r
16         Thu, 31 Jul 2014 19:10:11 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu\r
18         [18.7.68.35])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 9784B431FB6\r
22         for <notmuch@notmuchmail.org>; Thu, 31 Jul 2014 19:10:11 -0700 (PDT)\r
23 X-AuditID: 12074423-f79bf6d000007580-d3-53daf702bcb3\r
24 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id 61.55.30080.207FAD35; Thu, 31 Jul 2014 22:10:10 -0400 (EDT)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s712AA36008863; \r
31         Thu, 31 Jul 2014 22:10:10 -0400\r
32 Received: from drake.dyndns.org\r
33         (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
34         [216.15.114.40]) (authenticated bits=0)\r
35         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
36         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s712A6KK029969\r
37         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
38         Thu, 31 Jul 2014 22:10:09 -0400\r
39 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
40         (envelope-from <amdragon@mit.edu>)\r
41         id 1XD2IH-00033S-Pm; Thu, 31 Jul 2014 22:10:05 -0400\r
42 From: Austin Clements <amdragon@MIT.EDU>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v3 00/13] Implement and use database "features"\r
45 Date: Thu, 31 Jul 2014 22:09:50 -0400\r
46 Message-Id: <1406859003-11561-1-git-send-email-amdragon@mit.edu>\r
47 X-Mailer: git-send-email 2.0.0\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsUixCmqrcv0/VawQd90S4vVc3ksrt+cyezA\r
50         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZcyec5OxoEWkYuPFU4wNjFMFuhg5OSQETCRO\r
51         /tnPCmGLSVy4t56ti5GLQ0hgNpPEljOdUM5GRonNvX3sEM4dJonXW/5AZeYyShy4vp0ZpJ9N\r
52         QENi2/7ljCC2iIC0xM67s8HmMgvISvw4/wfMFhawl1ja+R3MZhFQlThw5RuYzSvgING/4B8z\r
53         xB1yEg03PrFNYORdwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdMLzezRC81pXQTIyg02F2U\r
54         dzD+Oah0iFGAg1GJh3dG+K1gIdbEsuLK3EOMkhxMSqK8Nh+BQnxJ+SmVGYnFGfFFpTmpxYcY\r
55         JTiYlUR4X34AyvGmJFZWpRblw6SkOViUxHnfWlsFCwmkJ5akZqemFqQWwWRlODiUJHjPfAVq\r
56         FCxKTU+tSMvMKUFIM3FwggznARp+DaSGt7ggMbc4Mx0if4pRUUqcdw9IQgAkkVGaB9cLi91X\r
57         jOJArwjzPgSp4gHGPVz3K6DBTECDn9+6DjK4JBEhJdXAuHnvin3HXOv68/YfWh/7b0rJrczP\r
58         U7ZFe6WdPLaptIEjT1W9VDvc/WDGmW63t7eveOQs226xSis+ZHFdWtXWrVaiE17JxfEl2tWa\r
59         hily5ZrNtK76ESro7LgmnW3XlhPxTN+LLbXni5hmrpfnljCrOXzuxO95eg/32/+4Ln+87VB3\r
60         3oRbUcHPlFiKMxINtZiLihMBhVnICbgCAAA=\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Fri, 01 Aug 2014 02:10:19 -0000\r
74 \r
75 This is v3 of id:1406652492-27803-1-git-send-email-amdragon@mit.edu.\r
76 This fixes one issue and tidies up another thing in\r
77 notmuch_database_upgrade I found while working on change tracking\r
78 support.  Most of the patches are logically identical to v2, but the\r
79 changes ripple through the patch context, so I'm sending a new series.\r
80 \r
81 First, this updates notmuch->features before starting the upgrade,\r
82 rather than after, so that functions called by upgrade will use the\r
83 new database features instead of the old (this didn't matter in this\r
84 series because nothing modified the database differently depending on\r
85 features).  Second, this combines multiple _notmuch_message_sync calls\r
86 into one, which cleans up the code, should further improve upgrade\r
87 performance, and makes way for additional per-message upgrades.\r
88 \r
89 The diff from v2 is below (excluding patch 2, which David pushed).\r
90 \r
91 diff --git a/lib/database.cc b/lib/database.cc\r
92 index b323691..d90a924 100644\r
93 --- a/lib/database.cc\r
94 +++ b/lib/database.cc\r
95 @@ -1252,6 +1252,10 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
96      /* Perform the upgrade in a transaction. */\r
97      db->begin_transaction (true);\r
98  \r
99 +    /* Set the target features so we write out changes in the desired\r
100 +     * format. */\r
101 +    notmuch->features = target_features;\r
102 +\r
103      /* Perform per-message upgrades. */\r
104      if (new_features &\r
105         (NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_BOOL_FOLDER)) {\r
106 @@ -1280,7 +1284,6 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
107                 if (filename && *filename != '\0') {\r
108                     _notmuch_message_add_filename (message, filename);\r
109                     _notmuch_message_clear_data (message);\r
110 -                   _notmuch_message_sync (message);\r
111                 }\r
112                 talloc_free (filename);\r
113             }\r
114 @@ -1289,10 +1292,10 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
115              * probabilistic and stemmed. Change it to the current\r
116              * boolean prefix. Add "path:" prefixes while at it.\r
117              */\r
118 -           if (new_features & NOTMUCH_FEATURE_BOOL_FOLDER) {\r
119 +           if (new_features & NOTMUCH_FEATURE_BOOL_FOLDER)\r
120                 _notmuch_message_upgrade_folder (message);\r
121 -               _notmuch_message_sync (message);\r
122 -           }\r
123 +\r
124 +           _notmuch_message_sync (message);\r
125  \r
126             notmuch_message_destroy (message);\r
127  \r
128 @@ -1348,7 +1351,6 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,\r
129         }\r
130      }\r
131  \r
132 -    notmuch->features = target_features;\r
133      db->set_metadata ("features", _print_features (local, notmuch->features));\r
134      db->set_metadata ("version", STRINGIFY (NOTMUCH_DATABASE_VERSION));\r
135 \r