[PATCH 0/9] Fix directory lookup on read-only databases
authorAustin Clements <amdragon@MIT.EDU>
Fri, 18 May 2012 04:13:33 +0000 (00:13 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:11 +0000 (09:47 -0800)
cf/d1203a667ef370b4b72b1dfd8e205bb6e3cef3 [new file with mode: 0644]

diff --git a/cf/d1203a667ef370b4b72b1dfd8e205bb6e3cef3 b/cf/d1203a667ef370b4b72b1dfd8e205bb6e3cef3
new file mode 100644 (file)
index 0000000..acb54f0
--- /dev/null
@@ -0,0 +1,97 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 715B7431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 17 May 2012 21:13:55 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id tdhbEzc0nGX1 for <notmuch@notmuchmail.org>;\r
+       Thu, 17 May 2012 21:13:54 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+       [18.7.68.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id EB1D5431FD4\r
+       for <notmuch@notmuchmail.org>; Thu, 17 May 2012 21:13:52 -0700 (PDT)\r
+X-AuditID: 12074424-b7fae6d000000906-f6-4fb5cc80a3d0\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 44.51.02310.08CC5BF4; Fri, 18 May 2012 00:13:52 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q4I4DpsQ009476\r
+       for <notmuch@notmuchmail.org>; Fri, 18 May 2012 00:13:52 -0400\r
+Received: from drake.mit.edu\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4I4Dn4d026780\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)\r
+       for <notmuch@notmuchmail.org>; Fri, 18 May 2012 00:13:51 -0400 (EDT)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>) id 1SVEZZ-0000yp-Io\r
+       for notmuch@notmuchmail.org; Fri, 18 May 2012 00:13:49 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/9] Fix directory lookup on read-only databases\r
+Date: Fri, 18 May 2012 00:13:33 -0400\r
+Message-Id: <1337314423-3702-1-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42IRYrdT1204s9XfYGsDh8X1mzOZHRg9nq26\r
+       xRzAGMVlk5Kak1mWWqRvl8CVMa+VpeAoV8WelTPZGhifs3cxcnJICJhIND66ygZhi0lcuLce\r
+       yObiEBLYxyjx5ckrJgjnHKPEsTfTWCCcv0wSmybdYQRpERLYwShx5bUuiM0moCGxbf9ysLiI\r
+       gLTEzruzWUFsYQEHibWvJjGB2CwCqhIX3j0Es3kF7CUuX54DdYa8xNP7fWwTGHkWMDKsYpRN\r
+       ya3SzU3MzClOTdYtTk7My0st0jXXy80s0UtNKd3ECPa2i8oOxuZDSocYBTgYlXh4BeZv9Rdi\r
+       TSwrrsw9xCjJwaQkyvv9JFCILyk/pTIjsTgjvqg0J7X4EKMEB7OSCK9sN1CONyWxsiq1KB8m\r
+       Jc3BoiTOq6H1zk9IID2xJDU7NbUgtQgmK8PBoSTBu+k0UKNgUWp6akVaZk4JQpqJgxNkOA/Q\r
+       8EyQGt7igsTc4sx0iPwpRkUpcd4ykIQASCKjNA+uFxaNrxjFgV4R5p0AUsUDjGS47ldAg5mA\r
+       BpflbgIZXJKIkJJqYDTQO3Bnyt9LLz9cfWTtJ3s5YcuclxM9uDwj1PT/Hb62/IJn9qGJRQKc\r
+       WrkHI2c9Tdj+n7G++IP321zDNzb7JiqoZh54GtQpdGXawfgoP8nNzZ/Pr7PR2cXiwL9I6sol\r
+       5pMefjsXGn9uW7DgSNa/V4x8K16ov9y/zMw0wiUkrZWzJ0o2ykpM84wSS3FGoqEWc1FxIgD1\r
+       G1kOoQIAAA==\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 18 May 2012 04:13:55 -0000\r
+\r
+This fixes notmuch_database_get_directory and\r
+notmuch_database_find_message_by_filename so that they don't attempt\r
+to create missing directory documents.  This makes them work on\r
+read-only databases (and prevents n_d_f_m_b_f from crashing\r
+unceremoniously on read-only databases).\r
+\r
+Unfortunately, there are several functions involved in directory\r
+document lookup, so the first three patches simply add a creation flag\r
+at each necessary layer.  The remaining patches then fix up the two\r
+API functions and their uses.\r
+\r
+If we do a 0.13.1 bug fix release, these patches could go in to\r
+complement the API changes made in 0.13 to support these fixes.  David\r
+can make that call.\r
+\r
+There are several patches, but they're all short and incremental.\r
+\r
+ bindings/python/notmuch/database.py |   11 -----------\r
+ lib/database.cc                     |   40 +++++++++++++++++++++++++---------------\r
+ lib/directory.cc                    |   41 +++++++++++++++++++++++++++++++++++------\r
+ lib/message.cc                      |   11 +++++------\r
+ lib/notmuch-private.h               |   13 +++++++++++++\r
+ lib/notmuch.h                       |   10 ++--------\r
+ notmuch-new.c                       |   36 +++++++-----------------------------\r
+ test/python                         |    8 ++++++++\r
+ 8 files changed, 95 insertions(+), 75 deletions(-)\r
+\r