-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Git status is triggering far too often on a large repo (during build) #231140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can also add the |
Thanks @lszomoru Do you know why VSCode still watches gitignored folders? Is this intentional? Or the logic wasn't added to ignore them. Even if the watching is required, having git fire "git status" on ignored folders is certainly a bug (due to there being no change). It seems like this should be off by default, rather than developers needing to explicitly set this. It is also unnecessarily using a lot of resource when builds happen. This took me a while to figure out, so I'm sure other developers have fallen into this issue without knowing why it's happening. |
Looking at the code, there are two event listeners set up:
At the moment the workspace folder listener does not factor in the |
On Linux, I had a similar issue. In my case, the operating system actually ran out of user watches due to the large number of files in the output build directory. The project was smaller, so I didn't notice any major build slowdowns, but the shortage of user watches did cause problems. I was able to fix my issue by manually updating |
I've attempted to fix this here but ill need the help from a maintainer to explain why the glob patterns aren't matching up. it looks like this particular part of the code only accepts a single pattern so i can't do a coma-separated list of patterns here, and a grouping pattern won't work either. |
Does this issue occur when all extensions are disabled?: N/A
I noticed Git goes crazy whenever I build Chromium. It shouldn't be because I'm not running any Git-related tasks while this is happening, it takes up a lot of CPU. I noticed this older issue: #177773
I follow the same steps mentioned here and looked at the trace output.
It looks like every time the build generates a new file in the
out
directory it triggers the git extension to rungit status
again. I think I've managed to calm it down a bit by setting"git.autorefresh": false,
, you can see the output below.Output:
Despite it skipping this still looks like a bug, the
out
directory is in my gitignore so it shouldn't be doing anything on changes within this directory at all anyway. Should there be logic added to here to not trigger git commands if the file changes are in an ignored repository?Using
autorefresh false
is a workaround to the problem but not a proper solution as I do want git to update when genuine files have changed. Maybe either the git extension should be fixed, or the built-in workspace watcher has a config to not watch ignored folders.Steps to Reproduce:
The text was updated successfully, but these errors were encountered: