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

GitLens triggers unwanted repository detection through npm autodetect #3708

Open
karolpiczak opened this issue Nov 2, 2024 · 0 comments
Open
Labels
bug Something isn't working triage Needs to be looked at

Comments

@karolpiczak
Copy link

Description

Environment

  • VS Code: 1.95.0
  • GitLens: 15.6.2
  • Git configuration: Multiple repositories in a single workspace (no submodules)
  • Workspace setup: Single root with multiple subdirectories and symlinked directories at the top level

Expected Behavior

With "git.autoRepositoryDetection": "openEditors", only repositories containing currently open editors should be detected and activated.

Actual Behavior

When a .json file is opened, npm autodetect triggers and causes GitLens to activate all repositories containing a package.json file, regardless of the git.autoRepositoryDetection setting.

Steps to Reproduce

  1. Set up a workspace with multiple git repositories/package.json files.
  2. Configure "git.autoRepositoryDetection": "openEditors", and "npm.autoDetect": "on".
  3. Open a .json file in any of the repositories.
  4. Observe that GitLens opens all repositories containing package.json files, even if they don't contain open editors.

Workaround

Setting "npm.autoDetect": "off" prevents the unwanted repository detection.

Additional Notes

  • This behavior only occurs with GitLens enabled.
  • Standard VS Code git functionality works as expected without GitLens.
  • It appears that npm's task autodetection mechanism is inadvertently triggering GitLens' repository detection, bypassing the normal repository discovery rules.

GitLens Version

15.6.2

VS Code Version

Version: 1.95.0
Commit: 912bb683695358a54ae0c670461738984cbb5b95
Date: 2024-10-28T20:16:24.561Z
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.95.0 Chrome/128.0.6613.186 Electron/32.2.1 Safari/537.36

Git Version

git version 2.47.0

Logs, Screenshots, Screen Captures, etc

No response

@karolpiczak karolpiczak added bug Something isn't working triage Needs to be looked at labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs to be looked at
Projects
None yet
Development

No branches or pull requests

1 participant