hyper-statusline icon indicating copy to clipboard operation
hyper-statusline copied to clipboard

hyper-statusline causes index.lock errors in large repos

Open tylerfowle opened this issue 8 years ago • 7 comments

when in a very large repo (8+gigs), hyper-statusline will interfere with git commands and cause a lock

fatal: Unable to create '<path to repo>/.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.

tylerfowle avatar Feb 03 '17 22:02 tylerfowle

@tylerfowle

I'm not sure what the best approach to solve this issue is. I could check if index.lock exists and based on that delay the call, but it doesn't feel ideal. Any suggestions? ✌️

henrikruscon avatar Feb 17 '17 08:02 henrikruscon

@henrikdahl unfortunately no, this is a little beyond me. not exactly a direct fix, but maybe an option to turn on/off the git status would be helpful.

tylerfowle avatar Feb 17 '17 20:02 tylerfowle

I get this same error on a 2.1GB repo. Strange thing is I only see the error on some commands. I don't know if this helps at all, but git pull and git push work fine, but often git stash and git commit -m fail with this error.

I would love to help - I've been walking through the middleware events that Hyper exposes and I don't see any obvious events that could better trigger the dirty checks.

jylertones avatar Mar 23 '17 20:03 jylertones

I had to remove hyper-statusline for this reason. Perhaps you could check for a lock before polling git like you suggest?

JackWReid avatar May 25 '17 09:05 JackWReid

Took another look at this.

Problem is basically that hyper-statusline performs a dirty check that can take a long time in larger repos which may cause a git index lock when trying to perform other git commands simultaneously.

In the latest commit I changed the dirty check to ignore untracked files, which should speed it up immensely and solve the issue for some of you.

Another solution could be git-update-index. But I'm not sure that hyper-statusline should be enforcing that instead of the specific user having an issue with a large repo.

Let me know how it works ✌️

henrikruscon avatar Aug 04 '17 11:08 henrikruscon

I have this problem only when working on a rebase. Random commits are cancelled due to index.lock errors.

hyper 2.1.1 hyper-statusline 1.7.6

ocarreterom avatar Jan 22 '19 18:01 ocarreterom

Ah this has been driving me insane for weeks. I finally tried my rebase in a large repo in Terminal on a whim and it worked and quickly realized this plugin was the issue.

shnhrrsn avatar Oct 10 '19 16:10 shnhrrsn