Re: Bug: fatal: Unable to create '.../.git/index.lock': File exists.
To
Aleksey Midenkov
Cc
Duy Nguyen
Johannes Schindelin
Git Mailing List
From
Jeff King
See Also
Prev Ref 1 Ref 2 Ref 3 Ref 4 Ref 5 Ref 6
Date
2019-05-02 15:07:01 UTC
On Thu, May 02, 2019 at 04:45:36PM +0300, Aleksey Midenkov wrote:

> > Assuming that kdevelop is just running "git status" in the background,
> > though, there's an easier solution. If it uses "git --no-optional-locks
> > status" instead, that will instruct it not to take the index lock at
> > all.
> 
> And can we disable optional locks at git configuration level? Because
> changing source code of each application that is not aware of this
> option is not an easier solution.

Since the decision of whether to use the locks is dependent on the
operation being performed, it's an environment variable and not a config
option. You should be able to do:

  GIT_OPTIONAL_LOCKS=0 kdevelop

and any commands run by kdevelop will avoid taking locks when they can
(but for now, the only command which does this is git-status anyway).

-Peff