From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Ruder Newsgroups: gmane.emacs.bugs Subject: bug#21559: additional patch needed to set GIT_OPTIONAL_LOCKS=0 in all cases Date: Tue, 25 Sep 2018 05:23:10 -0700 Message-ID: <20180925122309.GB68323@aeruder.net> References: <87wpvebraz.fsf@smart-cactus.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" X-Trace: blaine.gmane.org 1537888390 17458 195.159.176.226 (25 Sep 2018 15:13:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2018 15:13:10 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: alexei.khlebnikov@gmail.com, michael.albinus@gmx.de, dgutov@yandex.ru To: 21559@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 25 17:13:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4p1L-0004Mv-BP for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Sep 2018 17:13:04 +0200 Original-Received: from localhost ([::1]:53622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4p3R-0000Jo-GD for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Sep 2018 11:15:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4p3L-0000J9-6L for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 11:15:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4p3G-0003i8-W5 for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 11:15:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4p3G-0003hk-Ml for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 11:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4p3F-0002if-QJ; Tue, 25 Sep 2018 11:15:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87wpvebraz.fsf@smart-cactus.org> Resent-From: Andrew Ruder Original-Sender: "Debbugs-submit" Resent-CC: michael.albinus@gmx.de, alexei.khlebnikov@gmail.com, dgutov@yandex.ru, bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Sep 2018 15:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Xcc: michael.albinus@gmx.de, alexei.khlebnikov@gmail.com, dgutov@yandex.ru Original-Received: via spool by 21559-submit@debbugs.gnu.org id=B21559.153788849510426 (code B ref 21559); Tue, 25 Sep 2018 15:15:01 +0000 Original-Received: (at 21559) by debbugs.gnu.org; 25 Sep 2018 15:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:53910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4p39-0002i6-EH for submit@debbugs.gnu.org; Tue, 25 Sep 2018 11:14:55 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4mMz-0006hq-Hr for 21559@debbugs.gnu.org; Tue, 25 Sep 2018 08:23:14 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8D61F34E for <21559@debbugs.gnu.org>; Tue, 25 Sep 2018 08:23:12 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 25 Sep 2018 08:23:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aeruder.net; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=zeq7fVW3g+ALBrZVc edFJ5tBPZpkrtJ5zP026NlbaQs=; b=EDWo3soDO1Dc5PKvsjZS6TqNY8EZ8RseM O7EtImS7XzFlaei1bj/jj5W/lVixVsu2eH0U+QLXyNsZR/4gQRA4HHR94i38/Xxf 7Q9XvAl+n/acJRS51XnTBAzfgnbqUDuNbeQQvaHrcbufe4Ig078XRPuYg8fEKJyJ 76uJwTmQiheM/iDLVQiMHEtIYRqUuFu2oi20603sg8sIAYtUeZytH2fsd9E1yDYt mXuNhQrgSk3e+ljCzY5U2P7DEZK9+1CQc5xffPswXZsc9DRyer0haBXzSDqUIs24 +nIZQIPGe6APmayvAdX3HIDA4g4wwX3kPaxv6yeIkmaBAn8aM4tAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=zeq7fVW3g+ALBrZVcedFJ5tBPZpkrtJ5zP026NlbaQs=; b=KPoDTCwo J8WgEOR8A2u4TanW6lE4d5J/CADYuVaoONLWIq+d89Gkk4mZI2zCnQBvtB/FoV8h IrS0h12xq0oufqFv5A3cRJptG8CDjJ1ENx9ljKuIl6hrFH/3iSOESn7qQLFv6TtY dS3hFitPEOQvZMG6viNlzt0f5L/18uwk/MeQ6OJMVJbmwomvR+U88cKK9gtw55/j H+wwrE09c3xDdC3pGDmRt+uRzD9n8JlXJwKLd/brgV1s2HUxHWVxJzvLOvLq6KNs DO65nkAEVRkYC1B0yQuW17zuBuaVEQbltAg0rMss8NYwSJqxt9mDeZe/Pvn1yxpm 1BIy23HmAMj9Nw== X-ME-Proxy: X-ME-Sender: Original-Received: from aeruder.net (unknown [136.61.93.86]) by mail.messagingengine.com (Postfix) with ESMTPA id A5663E47C2 for <21559@debbugs.gnu.org>; Tue, 25 Sep 2018 08:23:11 -0400 (EDT) Content-Disposition: inline X-Mailman-Approved-At: Tue, 25 Sep 2018 11:14:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150651 Archived-At: --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Please see attached patch. There is also some early reports of success at https://github.com/magit/magit/issues/2708 In short, I believe the analysis for this bug was thorough (and correct!), but it turns out that the call to `git status` doesn't actually go through the patched function so we'd end up with a few commands getting GIT_OPTIONAL_LOCKS=0 but not the most important one. - Andrew Ruder P.S. still figuring out the contribution process for emacs. --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-for-25.0.50-auto-revert-mode-breaks-git-rebase-B.patch" >From b2a4c67cdd6fe834317416120b96ab943d6a1f7a Mon Sep 17 00:00:00 2001 From: Andrew Ruder Date: Mon, 24 Sep 2018 21:29:00 -0700 Subject: [PATCH] Fix for: "25.0.50; auto-revert-mode breaks git rebase" (Bug#21559) The fix for Bug#21559 is mostly right, but the one command we were trying to protect, git status --porcelain, doesn't go through vc-git-command and wasn't actually getting the GIT_OPTIONAL_LOCKS=0 treatment. * lisp/vc/vc-git.el (vc-git--call): Override GIT_OPTIONAL_LOCKS=0 during revert-buffer-in-progress-p --- lisp/vc/vc-git.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ca457fb3d1..cc137b2304 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1628,8 +1628,15 @@ vc-git--call (or coding-system-for-read vc-git-log-output-coding-system)) (coding-system-for-write (or coding-system-for-write vc-git-commits-coding-system)) - (process-environment (cons "PAGER=" process-environment))) - (push "GIT_DIR" process-environment) + (process-environment + (append + `("GIT_DIR" + "PAGER=" + ;; Avoid repository locking during background operations + ;; (bug#21559). + ,@(when revert-buffer-in-progress-p + '("GIT_OPTIONAL_LOCKS=0"))) + process-environment))) (apply 'process-file vc-git-program nil buffer nil command args))) (defun vc-git--out-ok (command &rest args) -- 2.17.0 --jI8keyz6grp/JLjh--