From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1AFA3431FB6 for ; Tue, 23 Sep 2014 11:45:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xIQ+5Ev2KARu for ; Tue, 23 Sep 2014 11:45:06 -0700 (PDT) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id EB636431FAF for ; Tue, 23 Sep 2014 11:45:05 -0700 (PDT) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1XWV5F-0003y0-Iw; Tue, 23 Sep 2014 15:45:05 -0300 Received: (nullmailer pid 20558 invoked by uid 1000); Tue, 23 Sep 2014 18:44:59 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] potential fix for nmbug merge problems Date: Tue, 23 Sep 2014 20:44:53 +0200 Message-Id: <1411497893-20407-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 2.1.0 In-Reply-To: <20140915181334.GL22539@odin.tremily.us> References: <20140915181334.GL22539@odin.tremily.us> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:45:09 -0000 --- scripts/nmbug | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) This seems to fix the problems with merges failing on dirty indexes. I didn't have time to trace through all of the ramifications, but it seems to me by doing a merge with the default index, we are getting some kind of random state (or maybe the state of the last merge). 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. diff --git a/scripts/nmbug b/scripts/nmbug index 77bec64..47e4ee8 100755 --- a/scripts/nmbug +++ b/scripts/nmbug @@ -457,10 +457,13 @@ def merge(reference='@{upstream}'): The default reference is '@{upstream}'. """ _insist_committed() + path = _os.path.join(NMBGIT, 'nmbug.index') + with _tempfile.TemporaryDirectory(prefix='nmbug-merge.') as workdir: _git( args=['merge', reference], - additional_env={'GIT_WORK_TREE': workdir}, + additional_env={'GIT_WORK_TREE': workdir, + 'GIT_INDEX_FILE': path}, wait=True) checkout() -- 2.1.0