From: Lars Schneider <larsxschneider@gmail.com>
To: Andreas Krey <a.krey@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: 'Failed to create .git/index.lock'
Date: Mon, 15 Feb 2016 18:06:33 +0100 [thread overview]
Message-ID: <5B9871D2-395D-4F0C-94FB-278832FCFD76@gmail.com> (raw)
In-Reply-To: <20160209075829.GA12331@inner.h.apk.li>
Hi Andreas,
I am looking into a similar issue with SourceTree on Windows right now. However, in my case it only happens when I switch branches. I investigated the Git commands that SourceTree triggers and it looks like it is doing something like this:
(1) Run checkout command
git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false checkout MY-BRANCH
(2) Run rev-parse command
git.exe --no-pager -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false rev-parse HEAD^1
My assumption is that SourceTree triggers these two commands in parallel and sometimes (2) locks the repo first which makes (1) fail. Does your Git process run on Windows, too? Is there a possibility that you issue Git commands in parallel? I also have read that certain anti virus software can trigger these errors on Windows.
I looked through the Git code found that increasing "core.packedrefstimeout" [1] might help in some cases that trigger this error [2] but not in others [3]. In my case this seems to help. Maybe it's worth a try for you, too?
Cheers,
Lars
[1] https://github.com/git/git/blob/494398473714dcbedb38b1ac79b531c7384b3bc4/refs/files-backend.c#L2070
[2] https://github.com/git/git/blob/494398473714dcbedb38b1ac79b531c7384b3bc4/lockfile.c#L171-L178
[3] https://github.com/git/git/blob/494398473714dcbedb38b1ac79b531c7384b3bc4/builtin/update-index.c#L1156
> On 09 Feb 2016, at 08:58, Andreas Krey <a.krey@gmx.de> wrote:
>
> Hi all,
>
> I have a single workspace where executing merges
> occasionally leads to a left-over .git/index.lock file
> that prevents me from adding resolved conflicted files.
>
> I'm running a sped-up integration/feature branch process,
> and the merges and conflict resolution are automated.
> But the index.lock thing is happening only in one repo
> of the three that are doing this.
>
> Any hints as to debugging this?
>
> (It is not a running background gc, the lock file
> is still around when there is nothing running
> any more, for hours.)
>
> Andreas
>
> --
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-15 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 7:58 'Failed to create .git/index.lock' Andreas Krey
2016-02-15 17:06 ` Lars Schneider [this message]
2016-02-15 21:34 ` Andreas Krey
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=5B9871D2-395D-4F0C-94FB-278832FCFD76@gmail.com \
--to=larsxschneider@gmail.com \
--cc=a.krey@gmx.de \
--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).