From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mitchel Humpherys Newsgroups: gmane.emacs.bugs Subject: bug#21559: 25.0.50; auto-revert-mode breaks git rebase Date: Sat, 06 Feb 2016 17:34:49 -0800 Message-ID: <87zivd8fra.fsf@gmail.com> References: <87wpvebraz.fsf@smart-cactus.org> <87oabu9fwh.fsf@smart-cactus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454808919 28309 80.91.229.3 (7 Feb 2016 01:35:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2016 01:35:19 +0000 (UTC) Cc: 21559@debbugs.gnu.org To: Ben Gamari Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 07 02:35:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aSEFq-0005lk-AS for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 02:35:10 +0100 Original-Received: from localhost ([::1]:58216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSEFp-0005nQ-GN for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Feb 2016 20:35:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSEFl-0005mZ-KP for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 20:35:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSEFi-00044b-FN for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 20:35:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSEFi-00044W-Ao for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 20:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSEFi-0001a0-3i for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2016 20:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mitchel Humpherys Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Feb 2016 01:35:02 +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.14548089006061 (code B ref 21559); Sun, 07 Feb 2016 01:35:02 +0000 Original-Received: (at 21559) by debbugs.gnu.org; 7 Feb 2016 01:35:00 +0000 Original-Received: from localhost ([127.0.0.1]:36195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSEFf-0001Zh-Vx for submit@debbugs.gnu.org; Sat, 06 Feb 2016 20:35:00 -0500 Original-Received: from mail-pf0-f178.google.com ([209.85.192.178]:33997) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSEFe-0001ZS-CL for 21559@debbugs.gnu.org; Sat, 06 Feb 2016 20:34:58 -0500 Original-Received: by mail-pf0-f178.google.com with SMTP id o185so89877712pfb.1 for <21559@debbugs.gnu.org>; Sat, 06 Feb 2016 17:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=yRRitDhIUnHXssD12wVU8lA1S8hmFUQMtBRwBaNrt28=; b=eiSPE4861rEtS5VG1kMhCkzyNaKdrmj3ofhEMbQq8TlLRHuo6trD8kqQktc6Fpor6I 4H6GIzCapQistpxN6euN0mLEOZnaufLlUz9ClRAav9XI9ShWtSa4WVEy/jyU966UmyoM ELY+Hrhm3GR0UGvFCEoXJKhl15WkWC386BFV62adrULlcqZumeFPb8rz63deY7WrFJqI UzPmLDWMwCH0/4aaYAhPiRudzzYyOC7fhf/HVoRDK/1Re4S7nK5Z/J9nsfagdpkPOkPx dZFjenCHzFAocWacdatZdVuv0HIUhRB/K8c9S5T0yvCm0FK3soA1HPmDIZfHRtx4nd5r /SrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yRRitDhIUnHXssD12wVU8lA1S8hmFUQMtBRwBaNrt28=; b=NgfPKpuHmc0UJyxtsmmmHoCa4uPyQm0SoW2cgcBEvnMWAeSEMgEDizwvxJxCwFDDV7 Dxabon0C1LxS/ehVKF/FZLWH2olJaUs4OL4MZSbW8OmJdqX4giNWvxx6V2fe2HlEXk76 qjkLcNxvZjoForg1UAe0W3Em8AMASGZpwZawDJgEta3zudROO03n89xEgsiO4Pm0OUWV L44EMWa5udGFIhkiRXhURJ3izBX9RrsEaZd9k8blXZY1Ta3vf1raia1L7dIY7SeZERPr ZU9nZ4IiUraCw3KyNQqHXPwGH7jvZAN1z5i2mwn8IHjnBoao8S2KUUeZ7rFjGHUg96em f3XQ== X-Gm-Message-State: AG10YOSBugj9yE1D0+lFlY0vzIwtlXBjurBroROTPlInT1KgP2AkiDTHNQB0DLrJ3GN7aA== X-Received: by 10.98.72.202 with SMTP id q71mr31515023pfi.69.1454808892476; Sat, 06 Feb 2016 17:34:52 -0800 (PST) Original-Received: from algz ([2600:8801:f900:f34:21e:65ff:fe80:25f6]) by smtp.gmail.com with ESMTPSA id fa3sm33704256pab.45.2016.02.06.17.34.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Feb 2016 17:34:51 -0800 (PST) In-Reply-To: <87oabu9fwh.fsf@smart-cactus.org> (Ben Gamari's message of "Sat, 06 Feb 2016 13:34:06 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112587 Archived-At: On Sat, Feb 06 2016 at 01:34:06 PM, Ben Gamari wrote: > Mitchel Humpherys writes: > >> On Fri, Sep 25 2015 at 03:45:56 PM, Ben Gamari wrote: >>> Arguably `git rebase` should be holding the `index.lock` for the entire >>> duration of the process (or be more resilient to the lock being taken) >>> but sadly this isn't the case. Emacs should behave appropriately to >>> accomodate this behavior. >> >> I don't think this is quite right. As I understand it, git only takes >> index.lock for operations that mutate the index [1]. >> >> It wouldn't make sense for git to hold index.lock for the entirety of >> the rebase operation since you can stop in the middle of an interactive >> rebase and do anything you want (mess with the index, add new commits, >> anything). >> > Ahh, yes. You are quite right. > >> I think the real question is: why is vc-find-file-hook (or >> vc-refresh-state) trying to mutate the index? Shouldn't refreshing a >> buffer be a read-only operation (at least with respect to the VCS)? >> > As far as I can tell vc-find-file-hook is merely calling `git ls-files > -c -z -- $FILE`, which sounds to me like it should indeed be a read-only > operation. I'm able to reliably reproduce this on the tip of the emacs-25 branch with emacs -Q with: $ cd /path/to/emacs $ ./src/emacs -Q lisp/*.el [ M-x global-auto-revert-mode ] $ for i in $(seq 30); do for f in lisp/*.el; do echo "; $i" >> $f; done; git commit -am "test $i"; done You might need to increase the `30' value in order to see it happen depending on your disk speed, etc. I took a quick look at the git source and the main source of this particular error seems to be from the `git update-index' command. I see that vc-git.el is calling `git update-index' in a few places but my attempts at instrumenting the code to track down where it was coming from were fruitless. I tried: (setq vc-command-messages t) as well as: (defun vc-git-command (buffer okstatus file-or-list &rest flags) "A wrapper around `vc-do-command' for use in vc-git.el. The difference to vc-do-command is that this function always invokes `vc-git-program'." (let ((coding-system-for-read vc-git-commits-coding-system) (coding-system-for-write vc-git-commits-coding-system)) + (message "git: %s %s" file-or-list flags) Any ideas on how we can trace every git command that vc-git.el is running? I'm suspicious that we're calling `git update-index' in the auto revert path somewhere...