Skip to content

.git/index.lock can be held when vscode is in background because of GitLens calls to git status #163

@joelhock

Description

@joelhock
  • gitlens|eam|5.5.0
  • VSCode Version: Code 1.17.0 (be377c0faf7574a59f84940f593a6849f12e4de7, 2017-10-05T06:07:51.906Z)
  • OS Version: Darwin x64 16.7.0

Steps to Reproduce:

  1. switch from vscode to terminal (so that vscode is in the background)
  2. touch file (or do something that touches files, like a git pull --rebase)
  3. see that getStatusForRepo('/my/path/to/repo') is called in GitLens output channel
  4. if operation in terminal needs .git/index.lock (e.g. a git rebase operation), it may fail, since the GitLens getStatusForRepo may be holding the lock.

vscode's grabbing of the .git/index.lock has been the source of a number of issues filed against it, the main one of which is microsoft/vscode#11918
other extensions are now being identified that do the same thing, such as:
letmaik/vscode-git-tree-compare#24

The behavior of GitLens can be sidestepped with gitlens.gitExplorer.includeWorkingTree": false, but I think GitLens should either not call git status when vscode is in the background via the mechanism introduced in microsoft/vscode@475fb0e, or it should instruct git (well, future versions of git) to not grab the lock during git status calls via the mechanism in microsoft/vscode#35513

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions