Skip to content

Git status is triggering far too often on a large repo (during build) #231140

@jasonwilliams

Description

@jasonwilliams

Does this issue occur when all extensions are disabled?: N/A

  • VS Code Version: 1.94.2
  • OS Version: Windows 10

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 run git 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:

2024-10-11 19:35:37.122 [debug] [FileEventLogger][onWorkspaceWorkingTreeFileChange] C:\chromium\out\obj\third_party\blink\renderer\core\testing\sequence_test-bcfbf884.obj.tmp
2024-10-11 19:35:37.601 [trace] [Repository][onFileChange] Skip running git status because autorefresh setting is disabled.
2024-10-11 19:35:37.601 [debug] [FileEventLogger][onWorkspaceWorkingTreeFileChange] C:\chromium\out\obj\third_party\blink\renderer\core\testing\null_execution_context-fd483ba5.obj.tmp
2024-10-11 19:35:38.001 [trace] [Repository][onFileChange] Skip running git status because autorefresh setting is disabled.
2024-10-11 19:35:38.001 [debug] [FileEventLogger][onWorkspaceWorkingTreeFileChange] C:\chromium\out\obj\third_party\blink\renderer\core\core_hot\selector_query.obj
2024-10-11 19:35:38.001 [trace] [Repository][onFileChange] Skip running git status because autorefresh setting is disabled.
2024-10-11 19:35:38.001 [debug] [FileEventLogger][onWorkspaceWorkingTreeFileChange] C:\chromium\out\obj\third_party\blink\renderer\core\core_hot\selector_query-0130c7b5.obj.tmp
2024-10-11 19:35:38.635 [trace] [Repository][onFileChange] Skip running git status because autorefresh setting is disabled.
thousands more...

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:

  1. Load Chromium in VS Code
  2. Build Chromium
  3. Git activity goes super high in task manager (parent process being VS Code)

Metadata

Metadata

Assignees

Labels

gitGIT issuesperformanceunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions