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

Activate for projects within git repos #33

Open
oscar-b opened this issue Dec 12, 2023 · 3 comments
Open

Activate for projects within git repos #33

oscar-b opened this issue Dec 12, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@oscar-b
Copy link

oscar-b commented Dec 12, 2023

Hi

I have a project which sits inside a subfolder of the git repo, so vscode-git-line-blame isn't initialised since the root folder that vscode sees doesn't hav a .git folder (it's a level higher up).

Is it possible to work around this issue with your extension?

@carlthome
Copy link
Owner

Ah, not sure. Happy to merge if you get subfolders to work. Seems VS Code is generally very oriented around having the workspace root be the git repo root.

This is the relevant configuration: https://github.com/carlthome/vscode-git-line-blame/blob/main/package.json#L29-L31

Guess it should be possible to set other activation events too, and then double-check that the git command acts in the right directory as per where the file is, somewhere here: https://github.com/carlthome/vscode-git-line-blame/blob/main/src/extension.ts#L34

@oscar-b
Copy link
Author

oscar-b commented Dec 13, 2023

Seems like most git extensions use onStartupFinished. And vscode itself seems to use git rev-parse --show-toplevel for this (a pity they don't expose this as an activation event.
https://code.visualstudio.com/docs/sourcecontrol/faq#_why-isnt-vs-code-discovering-git-repositories-in-parent-folders-of-workspaces-or-open-files

I also have git.openRepositoryInParentFolders set to always.

I've never touched vscode extensions before, but I might take a stab at it during christmas if you're not interested in making these changes.

@carlthome
Copy link
Owner

Would be nice to have this fixed but I've been a bit short on time/flow, sorry!

@carlthome carlthome added the help wanted Extra attention is needed label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants