question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS Code interacts poorly with Watchman-based fsmonitor, causing many Git commands running in background

See original GitHub issue

Hi, since I registered my react project for scalar I noticed that every 5 seconds a bunch of git commands is done in background for every file opened in Visual Studio code. Such a bunch is done every 5 seconds for every opened file:

> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse [...]
> git rev-parse --symbolic-full-name [...]@{u}
> git rev-list --left-right [...]...refs/remotes/origin/[...]
> git for-each-ref --sort -committerdate --format %(refname) %(objectname)
> git remote --verbose
> git config --get commit.template

This slows down vscode significantly when there are several files open.

Unregistering the project from scalar does not help. Only when removing the git config entries scalar adds the problem is solved:

       [...]
	multiPackIndex = true
	preloadIndex = true
	safecrlf = false
	untrackedCache = false
	hookspath = C:/project/.git/hooks
	fsmonitor = C:/project/.git/hooks/query-watchman
	fsmonitorHookVersion = 2

ENV:

  • latest Windows10
  • scalar: 20.06.171.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jeffhostetlercommented, Jun 14, 2021

I updated the builtin fsmonitor daemon code to put the cookie file deeper in the .git directory and confirmed that that prevented VSCode from overreacting when the daemon was active.

I need to independently fix and/or test the Watchman hook-based version.

1reaction
derrickstoleecommented, Oct 9, 2020

@derrickstolee the wathcman enty is causing it: fsmonitor = C:/project/.git/hooks/query-watchman as soon as I remove it vscode behaves as usual.

will scalar work without that entry properly or should I un-register to avoid other strange behavior?

Scalar will work without the fsmonitor feature. (In fact, it will not configure it if you do not have Watchman installed.)

THANK YOU @hbinkle for discovering the bad configuration value, and I will make sure we investigate why this feature is interacting badly with VS Code!

I hope you don’t mind, but I’m going to rename this issue to track the real cause.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git commands are still running in the background when ...
I believe background updates are correctly disabled now when Visual Studio code is not focused. But there are definitely still problems when ...
Read more >
VS Code - The git repository has too many active changes ...
This command searches a .git folder that is higher up in the directory tree of your files ... VsCode needs some time to...
Read more >
VS Code Git Background Commands Exposed - YouTube
VS Code Git Background Commands Exposed. 26K views · 11 months ago #shorts ...more. Visual Studio Code. 389K. Subscribe. 389K subscribers.
Read more >
Improve Git monorepo performance with a file system monitor
A daemon will be started automatically in the background by the next Git command. FSMonitor works well with core.untrackedcache , so we'll ...
Read more >
Remote Development Tips and Tricks
This article covers troubleshooting tips and tricks for each of the Visual Studio Code Remote Development extensions. See the SSH, Containers, and WSL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found