[PATCH] potential fix for nmbug merge problems
authorDavid Bremner <david@tethera.net>
Tue, 23 Sep 2014 18:44:53 +0000 (20:44 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:04:43 +0000 (10:04 -0800)
b1/02b4763d7c6493c5da09465468cd539d7c7495 [new file with mode: 0644]

diff --git a/b1/02b4763d7c6493c5da09465468cd539d7c7495 b/b1/02b4763d7c6493c5da09465468cd539d7c7495
new file mode 100644 (file)
index 0000000..521459a
--- /dev/null
@@ -0,0 +1,81 @@
+Return-Path: <bremner@tesseract.cs.unb.ca>\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 1AFA3431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 23 Sep 2014 11:45:09 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       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 xIQ+5Ev2KARu for <notmuch@notmuchmail.org>;\r
+       Tue, 23 Sep 2014 11:45:06 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id EB636431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 23 Sep 2014 11:45:05 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+       (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+       id 1XWV5F-0003y0-Iw; Tue, 23 Sep 2014 15:45:05 -0300\r
+Received: (nullmailer pid 20558 invoked by uid 1000); Tue, 23 Sep 2014\r
+       18:44:59 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] potential fix for nmbug merge problems\r
+Date: Tue, 23 Sep 2014 20:44:53 +0200\r
+Message-Id: <1411497893-20407-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <20140915181334.GL22539@odin.tremily.us>\r
+References: <20140915181334.GL22539@odin.tremily.us>\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: Tue, 23 Sep 2014 18:45:09 -0000\r
+\r
+---\r
+ scripts/nmbug | 5 ++++-\r
+ 1 file changed, 4 insertions(+), 1 deletion(-)\r
+\r
+This seems to fix the problems with merges failing on dirty indexes.\r
+I didn't have time to trace through all of the ramifications, but it\r
+seems to me by doing a merge with the default index, we are getting\r
+some kind of random state (or maybe the state of the last merge).\r
+\r
+I'll have to road test this a bit more to be sure it's a fix, but maybe you can think about whether it's the righ thing (TM) to do in any case.\r
+\r
+diff --git a/scripts/nmbug b/scripts/nmbug\r
+index 77bec64..47e4ee8 100755\r
+--- a/scripts/nmbug\r
++++ b/scripts/nmbug\r
+@@ -457,10 +457,13 @@ def merge(reference='@{upstream}'):\r
+     The default reference is '@{upstream}'.\r
+     """\r
+     _insist_committed()\r
++    path = _os.path.join(NMBGIT, 'nmbug.index')\r
++\r
+     with _tempfile.TemporaryDirectory(prefix='nmbug-merge.') as workdir:\r
+         _git(\r
+             args=['merge', reference],\r
+-            additional_env={'GIT_WORK_TREE': workdir},\r
++            additional_env={'GIT_WORK_TREE': workdir,\r
++                            'GIT_INDEX_FILE': path},\r
+             wait=True)\r
+     checkout()\r
\r
+-- \r
+2.1.0\r
+\r