Skip to content
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

[git] Git repo list gets refreshed too often and scans all of the filesystem #10415

Open
mwamp opened this issue Nov 15, 2021 · 2 comments
Open
Labels
git issues related to git proposal feature proposals (potential future features) 🤔 needs more info issues that require more info from the author

Comments

@mwamp
Copy link

mwamp commented Nov 15, 2021

Bug Description:

I am using theia in a cloud environment and remote filestores are sometimes mounted within the theia workspace. In this setting the find_git_repositories is called very often (I believe for most filesystem events) and scans all of the directories in the workspace reccursively.

I believe there are two issues that we might want or not want to address :

  1. Refreshing the list of git repos happens too often
  2. Exclusion (as set in theia settings) has no effect on this

I think a hotfix for me will be to make sure git repo discovery happens only once at initialization of the workspace. (people can reload the whole workspace if they added a repo).

It looks to me that propagating exclusion will need some work at the level of https://github.com/Axosoft/find-git-repositories
To me the easiest way around this issue would be to add one explicit button to refresh git repos and call repo discovery only at init and when this button is pressed. Though scanning explicitly ignored dirs is still bad behavior.

Steps to Reproduce:

I can just use debugging on my filesystem mount to log all filesystem accesses. In a general setup, I am not sure how to intercept fs calls.

Related :
It looks to me that the natural suspect was not the culprit this time
Axosoft/nsfw#134
Axosoft/nsfw#124

Additional Information

  • Operating System: ubuntu
  • Theia Version: 1.19.0
@vince-fugnitto vince-fugnitto added 🤔 needs more info issues that require more info from the author git issues related to git proposal feature proposals (potential future features) labels Nov 15, 2021
@vince-fugnitto
Copy link
Member

@mwamp thank you for the issue 👍

I think a hotfix for me will be to make sure git repo discovery happens only once at initialization of the workspace. (people can reload the whole workspace if they added a repo)

I think you can definitely make this hotfix downstream in your application, I don't believe we would want to change this behavior by default, adding new folders to the workspace (multi-root workspace) should not require a reload of the app.

On a side not, you may want to try to use the vscode-builtin-git and vscode-builtin-git-ui plugins yo your application as a replacement to @theia/git. It may have a better behavior, and will permit you to have other git-related plugins in your application in the future if necessary.

@mwamp
Copy link
Author

mwamp commented Nov 17, 2021

Thanks very much for the super quick answer and the fine suggestion!

Using the vscode plugins indeed seems to work for me as it does not seem to have the same behavior of scanning indiscriminately the filesystem.
Though there are some noticeable bugs (unregistered files throw a pop up when opened from the git interface for instance).

If you need any further info from me for this issue do not hesitate to ask. I believe the next best thing to fix this might be to integrate find_git_repo with nsfw events. That way you could scan only the parts of the filesystem that actually got changed instead of the whole thing. Though I guess this is not exactly a lightweight fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git proposal feature proposals (potential future features) 🤔 needs more info issues that require more info from the author
Projects
None yet
Development

No branches or pull requests

2 participants