Sertion / vscode-gitblame

Visual Studio Code Extension - See Git Blame info in status bar.
https://marketplace.visualstudio.com/items/waderyan.gitblame
MIT License
72 stars 31 forks source link

"Will not blame X, Outside the current workspace." #148

Closed YaroST12 closed 11 months ago

YaroST12 commented 11 months ago

Hello there,

Due to an annoying bug related to git gutters in vscode (https://github.com/microsoft/vscode/issues/176497) I have to use a workaround, which sets --git-dir argument to the actual directory of the .git folder...

... which causes git blame to think that all files are outside its current workspace. The workaround in question can be found here: https://stackoverflow.com/questions/75615136/vscode-vscodium-showing-git-gutters-even-though-there-are-no-actual-changes-in-t

Is there anything I can modify in the workaround script or in the extention itself to make them work well together? Thanks.

YaroST12 commented 11 months ago

I've updated my script to work nicely with both vscode and git blame extension, but I may have an idea as to why this extension started misbehaving: perhaps it makes more sense to parse --work-tree here instead of --git-dir: https://github.com/Sertion/vscode-gitblame/blob/main/src/git/util/gitcommand.ts#L71-L72

Sertion commented 11 months ago

General Furman.

I am not exactly sure what I can do here.

I've found some places in the extension where we assume that the git path and the file path has overlap and I'm working on changing them to be more generic. Other than that the modified script looks like it should work. The extension uses the vscode.git built-in extension to get the path to the git executable (permanent link).

Perhaps this was the issue you where running into?

YaroST12 commented 10 months ago

Hi, the modified script works. Waiting for VSCode to get fixed :(