From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#21559: 25.0.50; auto-revert-mode breaks git rebase Date: Tue, 20 Feb 2018 01:41:55 +0200 Message-ID: <5d7808ef-d61f-534d-53b3-bc1227b4c3b1@yandex.ru> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1519083688 31391 195.159.176.226 (19 Feb 2018 23:41:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 23:41:28 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 To: Alexei Khlebnikov , 21559@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 20 00:41:23 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 1env3R-0006p9-Vu for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Feb 2018 00:41:06 +0100 Original-Received: from localhost ([::1]:52811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1env5T-0000gH-QE for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Feb 2018 18:43:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1env5N-0000g0-DZ for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2018 18:43:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1env5K-0004nM-A6 for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2018 18:43:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1env5K-0004nE-4z for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2018 18:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1env5J-00085Q-M6 for bug-gnu-emacs@gnu.org; Mon, 19 Feb 2018 18:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Feb 2018 23:43: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: Original-Received: via spool by 21559-submit@debbugs.gnu.org id=B21559.151908372631012 (code B ref 21559); Mon, 19 Feb 2018 23:43:01 +0000 Original-Received: (at 21559) by debbugs.gnu.org; 19 Feb 2018 23:42:06 +0000 Original-Received: from localhost ([127.0.0.1]:51821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1env4Q-000847-01 for submit@debbugs.gnu.org; Mon, 19 Feb 2018 18:42:06 -0500 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:51215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1env4O-00083Z-75 for 21559@debbugs.gnu.org; Mon, 19 Feb 2018 18:42:04 -0500 Original-Received: by mail-wm0-f45.google.com with SMTP id h21so10702895wmd.1 for <21559@debbugs.gnu.org>; Mon, 19 Feb 2018 15:42:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PloGhic8Zqf/R8ARviBJOmZGZfGkwkznRkKoRECcm/k=; b=doZUFYmi3S82GgcK0FcfBGMImY9c2XKR2wGvISqcoSqdg6x3rKNhW8eKEXaQwF8wtB qkpB8CQj5+8k+cdKRiONxXX2AMH/g5CEVDvSf1qEiSShlM078vvba82+V8DFgPR0DT3k /LWqJgoSEay43vHjIhAJpH6VGGvD9RCebSAPQFpuqMGMovNZrK6NwJPa0Pum1IB3oUzA gfGonACg4b9iQDQT+Q+1xoWwme3dDFoN/BgSdITiy9oe5w1xW1XzcjYv5TUe7wdOLySq HYycCEi3Tdbtu71Lo1Neqycxb4UGugdG2CG/q72HjmLe/FvXd9RMyAXXUtrqqzD5Ait6 4uiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PloGhic8Zqf/R8ARviBJOmZGZfGkwkznRkKoRECcm/k=; b=SD6pVEdNBNzCw1olaPhB68kl3ZnvIdpEzLPY3y/Qby0bJbQij2anNRv24FzFBpZJQk 7D880aOEMZvafDh7YH7mi8InfcQE7so1MHemdVzw4NPvllSWjDb6nBvAe25bWLUBYlX/ msvysd6Tx4yLDJMmNg0I2ms7FvKrvGPqx/Z086PKSLS7ixVMo7rUdiNsOKFWRgpOkq5U WuCQndElMpEv7VSDYNMrLiJW6tvWIZCVUv/SP/X/0KZBt5eRdDGiCsQ+beNR2r8r+JnA EEsPYckcqBwFkkzWm8p0/lv25glQg7Bx3Qv0Nj/5pzJSztl3CrYtFPB9ZijdHxgT6gpl XC9w== X-Gm-Message-State: APf1xPCb+YLnFAzEJcOJ0+Eo/PrxO0lDcwOTkNphnZl5UknlfFnx9zEY AiaYn3hyyjdDqDyn/Eup4JlxQKVx X-Google-Smtp-Source: AH8x224Ldl+kQlZ/MTNdJpmG1wloW3lMd8VM847csDRSYT5nR1DeyT57mZ56wJ6DDcD3d3AsgQNZWQ== X-Received: by 10.28.172.130 with SMTP id v124mr12290806wme.16.1519083718212; Mon, 19 Feb 2018 15:41:58 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id a14sm3494378wra.27.2018.02.19.15.41.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 15:41:57 -0800 (PST) In-Reply-To: Content-Language: en-US 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:144041 On 2/15/18 9:08 PM, Alexei Khlebnikov wrote: > Judging from the comment of the commit implementing the > "--no-optional-locks" switch, > > https://github.com/git/git/commit/27344d6a6c8056664966e11acf674e5da6dd7ee3 > ​ > , the switch was implemented exactly for background refresh in "tools > like IDEs or fancy editors". > I.e. for mitigating this particular bug! Now we only have to use this > switch in our "fancy editor". OK, here's my question: what is a "background refresh"? Must be consider every VC operation to be "background"? From what I see of this switch's description, it's going to (slightly? imperceptibly?) slow down the VC operations. It would be cool to see some measurement of that effect. Failing that, why don't we try something else first? If the problem occurs solely due to auto-revert-mode's calls to Git, let's try adding that environment variable binding inside auto-revert-handler. The patch is below. Does it solve the problem as well? diff --git a/lisp/autorevert.el b/lisp/autorevert.el index cf145e0ee3..41e9f00049 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -709,7 +709,9 @@ auto-revert-handler ;; `preserve-modes' avoids changing the (minor) modes. But we do ;; want to reset the mode for VC, so we do it manually. (when (or revert auto-revert-check-vc-info) - (vc-refresh-state)))) + (let ((process-environment + (cons "GIT_OPTIONAL_LOCKS=0" process-environment))) + (vc-refresh-state))))) (defun auto-revert-tail-handler (size) (let ((modified (buffer-modified-p))