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 21:21:34 -0800 Message-ID: <877fih3xk1.fsf@gmail.com> References: <87wpvebraz.fsf@smart-cactus.org> <87oabu9fwh.fsf@smart-cactus.org> <87zivd8fra.fsf@gmail.com> <87vb613ye0.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454822541 18704 80.91.229.3 (7 Feb 2016 05:22:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2016 05:22:21 +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 06:22:12 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 1aSHnY-0005uF-Dn for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 06:22:12 +0100 Original-Received: from localhost ([::1]:59681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSHnX-0006M9-Jh for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 00:22:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSHnU-0006M2-Cz for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 00:22:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSHnO-0001hW-78 for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 00:22:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSHnO-0001hS-3F for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 00:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSHnN-0006kE-VV for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 00:22:01 -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 05:22: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.145482250425902 (code B ref 21559); Sun, 07 Feb 2016 05:22:01 +0000 Original-Received: (at 21559) by debbugs.gnu.org; 7 Feb 2016 05:21:44 +0000 Original-Received: from localhost ([127.0.0.1]:36257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSHn5-0006jh-QE for submit@debbugs.gnu.org; Sun, 07 Feb 2016 00:21:43 -0500 Original-Received: from mail-pf0-f171.google.com ([209.85.192.171]:33848) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSHn4-0006jW-Tj for 21559@debbugs.gnu.org; Sun, 07 Feb 2016 00:21:43 -0500 Original-Received: by mail-pf0-f171.google.com with SMTP id o185so91644984pfb.1 for <21559@debbugs.gnu.org>; Sat, 06 Feb 2016 21:21:42 -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=yJTuwCgK9PLWGfBalSPJ3k+/v2Rwa/kNYYBcd6x/tFM=; b=Q6lMZ12jpZ2xn5qx/PoGZD1aiQnHLxQttWqbfvJX3KcqUfIBm9uFMekoSAon8m5jLb PusPOIrTG8r6LAkBxpdgX/bQgFndTPVKfda3DOGbSnZghh7h02Yie6aFCocR/ASU/Nit Znpmml3zbDNHW1KsHEeT0WxkESg8xZW1kSLRoPJbQw8DRhjB/3ZeCfWmp1mYFT6Cbw/p koHt+o5eJtW0ejlKe5lf0nFsn6GSsbsB+Ua7NqjKSpNfjHsnP8SmBFvPFDgMSiRr2JZ/ RbOU9Kpwb76AmBCOyLbLaiOwx+DA0qoRszlF7TxrxrIDk6UIpdUAQEQgv/U9o8bKHUWk BIPg== 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=yJTuwCgK9PLWGfBalSPJ3k+/v2Rwa/kNYYBcd6x/tFM=; b=XrG99vC4cA0y2GroMzETEQBRQK8zP3TEWT2+iycT3FS+vyySN2D4Arf9JhlqRiirj2 Rhv4AYAbyWGYoHf3kKK76UX1+HnRTO4cfJm1D0uPOOKJTh4aKbzz4vLJ+/0aEAHLBAg2 jav0TLEZ3v/nCT4WwzF1hcqykAZENBLa3FjADuwjnVGmzu7ntY387qZklqOVeGo+uD1b l4l3HnrKL2uxafpyWphiJ/4ByPghVaJkT/5YR4wlhhDrDlfRocscV0y30ZJSSOq0Fxze l8/GouFMlkHdr7l31nG9Y1G7f7FuqAqPH7gBJoDpccV+deSPfzrOpqdyJFJW5cUuO8nx SlFQ== X-Gm-Message-State: AG10YORxZJ6oP8ds67xhph2AfT0UxBf6o5t7eYWx2Eq2c44no8zYmr3+G9vPvXc3+T6qYw== X-Received: by 10.98.9.129 with SMTP id 1mr32762276pfj.163.1454822497073; Sat, 06 Feb 2016 21:21:37 -0800 (PST) Original-Received: from algz ([2600:8801:f900:f34:21e:65ff:fe80:25f6]) by smtp.gmail.com with ESMTPSA id m86sm34485733pfi.27.2016.02.06.21.21.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Feb 2016 21:21:36 -0800 (PST) In-Reply-To: <87vb613ye0.fsf@gmail.com> (Mitchel Humpherys's message of "Sat, 06 Feb 2016 21:03:35 -0800") 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:112592 Archived-At: On Sat, Feb 06 2016 at 09:03:35 PM, Mitchel Humpherys wrote: > On Sat, Feb 06 2016 at 05:34:49 PM, Mitchel Humpherys wrote: >> 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... > > Sorry, I take it all back. `git update-index' is the source of that one > particular index.lock error message, but it's certainly not the only > thing holding index.lock... And actually it looks like `git ls-files' > does take index.lock: > > $ cd /path/to/emacs/ > $ git ls-files # in another shell after running the following inotifywait: > $ inotifywait -m .git | grep index.lock > Setting up watches. > Watches established. > .git/ CREATE index.lock > .git/ OPEN index.lock > .git/ CLOSE_WRITE,CLOSE index.lock > .git/ DELETE index.lock > .git/ CREATE index.lock > .git/ OPEN index.lock > .git/ CLOSE_WRITE,CLOSE index.lock > .git/ DELETE index.lock > > I did a bit of git debugging and it looks like someone must be > registering an atexit handler or something that takes index.lock, > because it doesn't get taken in the ls-files code itself. It's taken > sometime after the `exit' function gets called in `handle_builtin' in > git.c. > > Anyways, I'm more inclined now to agree that this a git bug. I don't > see why `git ls-files' would be taking index.lock... So we're back to > the question of "how can Emacs handle this more gracefully". SORRY! I take it all back AGAIN. It was actually my shell's PS1 that was locking index.lock (due to a `git status'), not `git ls-files'! That's why it looked like it was happening when the program exited. Because it really was after the program exited :). That's embarassing... After re-running my experiment above in a non-fancy shell I don't see index.lock being taken at all when I run `git ls-files'. So we're back to instrumenting vc{,-git}.el to see exactly which git commands are being run when auto-revert refreshes a buffer.