This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
maybe: show better error msg if windows visual studio git outputs linux paths #131
Labels
You can continue the conversation there. Go to discussion →
So, ultimately, I think this is a PATH misconfiguration problem on my end, and fixing it has fixed my issue with GitInfo.
I'm running windows 10 + GitInfo latest 2.1.2, visual studio 2019 community edition.
I installed via Nuget and got a cascade of weird errors (like not being able to find the 'System' namespace)
My .sln file was in a directory, let's call it
D:\projects\project1\
The clue was this error message here:
The path is incorrect. Should be:
"D:\projects\project1\"
Instead, it's:
"D:\d\projects\project1\"
In the script, gitinfo uses
git rev-parse --show-toplevel
to get the path. If I run the visual studio version of git, I get this correct output:gives correct output of:
"D:\projects\project1\"
But what was happening was I had mingw64 version of git.exe (likely... incorrectly) in my path, and it was returning the unix-style path:
git rev-parse --show-toplevel
output was/d/projects/project1
Somewhere in GitInfo it was attempt to marry /d/project/project1 and D:\ and produced an incorrect path of:
"D:\d\projects\project1\"
Then it all failed. Fixing my path fixed the issue and now everything's fine.
I don't know if this bug is worth trying to figure out, or if it's better to say 'silly user, please fix your busted path'.
Either way, it might be nice to at least detect the condition and either convert to a windows-style path.
Or at least display some kind of error message to give a hint about what to fix. Something like "We detected your version of git using unix-style paths, we need you to fix your PATH so it has a windows-like path".
You could do it by looking for patterns like:
"{someuppercaseletter}:\{thesamebutlowercaseletter}\"
to catch strings that look like this:"D:\d\[whatever]"
Anyway, otherwise the plugin looks awesome, was just a little confused tracking down the issue as a first time user.
Thanks!
-Dom
The text was updated successfully, but these errors were encountered: