VS Code interacts poorly with Watchman-based fsmonitor, causing many Git commands running in background
See original GitHub issueHi, 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:
- Created 3 years ago
- Reactions:2
- Comments:14 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.