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

Not working and not useful error message #38

Closed Robert-Ernst closed 5 years ago

Robert-Ernst commented 5 years ago

I'm using Git Blame in VSCode with Windows10 and WSL Ubuntu. I'm using Github.com Repositories with 2FA with SSH remotes in all repos.

I don't have any annotations and if I try to show something per Git Blame: Show quick Info I will get this error: git_blame_code_error

Since I working almost only with the WSL, it could be that my Git in Windows (CMD, Path, etc) isn't properly configured. But I don't have any clue which Git information Git Blame is using, since it should simply use the SSH credentials.

Sertion commented 5 years ago

Hey Ernst.

Thank you for the issue!

There is more debug information available in the Output (View: Toggle Output) under "Extension: gitblame". By default it tries to use the git.path configuration from vscode and if that is null or missing it will try to execute git.

I have confirmed that there is a bug that will still display the template commit if the quick info is displayed using the command.

Sertion commented 5 years ago

I have released a fix for the 00000... message.

Robert-Ernst commented 5 years ago

@Sertion Here is my output

[ 16:40:16 | command ] git rev-parse --show-toplevel
[ 16:40:16 | error ] Error
[ 16:40:16 | info ] File "c:\path\file.md" is not a decendant of a git repository
[ 16:40:16 | info ] File "c:\path\file.md" is not a decendant of a git repository
[ 16:40:27 | info ] Will not try to blame file "\extension-output-#2" as it is outside of the current workspace

But the message is kinda misleading. There is a .git folder next to it and it is a Git Repository. I tested it aswell with Open Folder in the parent directory (spanning several Git Folder) aswell with opening a single project folder

Robert-Ernst commented 5 years ago

Not sure if your fix is already applied. But the 0000... error is gone indeed

Sertion commented 5 years ago

Thank you for getting back to me @BerndErnst!

A fix for the 0000... error did indeed get deployed yesterday. Great to hear that it worked for you.

As for the misleading messages: If the git rev-parse --show-toplevel command can't find a git-folder vscode-gitblame will not press the issue further and accept that there is no git repository available for the file.

When there is an error executing a command vscode-gitblame logs what was outputted to stderr by the command. In this case it was the rather unhelpful Error. Is it possible for you to run git rev-parse --show-toplevel in the folder where file.md is?

P.S. The relevant functions are GitFilePhysical.executeGitRevParseCommand and execute if anyone want's to have a look.

Yottster commented 5 years ago

@BerndErnst Could it be that git is missing from the host os? Have you looked in to wslgit?

Sertion commented 5 years ago

A version that should resolve this issue was released last week.