git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: git@vger.kernel.org
Subject: Git rebase dies with fatal: Unable to create '.../.git/index.lock': File exists.
Date: Mon, 16 Sep 2013 12:28:52 -0600	[thread overview]
Message-ID: <20130916182852.GA14513@obsidianresearch.com> (raw)

Scenario, run:

 $ git rebase  v3.10.12 --autosquash  -i

And randomly get this:

 fatal: Unable to create '.../linux/.git/index.lock': File exists.

 If no other git process is currently running, this probably means a
 git process crashed in this repository earlier. Make sure no other git
 process is running and remove the file manually to continue.
 Could not apply ....

I've noticed this happening randomly for a few years now, and always
chalked it up to NFS weirdness, but I figured out what is going on
today (as I am not using NFS right now)..

I have emacs windows open that have files within the git tree open in
them. My emacs has vc-git mode loaded and global-auto-revert-mode set.

During the rebase the files open in emacs are changed by git, when
emacs notices this (which is random with respect to the ongoing
rebase) it auto reverts and runs git commands (due to vc-git), which
causes the rebase to randomly fail.

Worse, I've noticed that this also randomly seems to cause the rebase
to loose a commit if you --continue from that point.

Can git have some retry in the locking so this doesn't happen?

Jason

             reply	other threads:[~2013-09-16 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-16 18:28 Jason Gunthorpe [this message]
2013-09-16 21:15 ` Git rebase dies with fatal: Unable to create '.../.git/index.lock': File exists Jeff King
2013-09-16 21:21   ` Jason Gunthorpe
2013-09-16 21:47     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130916182852.GA14513@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).