-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
After installing Git "rc" version, PowerShell reports an error #845
Comments
The regex use to validate the Git version lives here: posh-git/src/CheckRequirements.ps1 Line 11 in 5a87e8a
The warning is from past issues with folks using the Cygwin build of Git which doesn't include You can set posh-git/src/CheckRequirements.ps1 Lines 18 to 20 in 5a87e8a
|
Extending this in the following way seems to fix the issue for me: diff a/src/CheckRequirements.ps1 b/src/CheckRequirements.ps1
--- a/src/CheckRequirements.ps1
+++ b/src/CheckRequirements.ps1
@@ -10,+3 +10,+3 @@
-if ([string](git --version 2> $null) -match '(?<ver>\d+(?:\.\d+)+)(?<g4w>\.windows)?') {
+if ([string](git --version 2> $null) -match '(?<ver>\d+(?:\.\d+)+)(?<g4w>(\.rc\d+)?\.windows)?') {
$script:GitVersion = [System.Version]$Matches['ver'] @DustinWin can you verify that this works for you? If so, would you mind opening the PR? |
Can you think of a reason not to make this morning forgiving, e.g. |
That should work! |
The version check was a bit too tight. This fixes dahlbyk#845. Note: it was suggested in that ticket to use a laxer version check, but that looks as if it might have unwanted consequences, so let's give just an inch for starters. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The version check was a bit too tight. This fixes dahlbyk/posh-git#845. Note: it was suggested in that ticket to use a laxer version check, but that looks as if it might have unwanted consequences, so let's give just an inch for starters. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Git version: 2.31.0-rc2 (all rc version)
Operating system version: Windows 10 21H1
PowerShell version: comes with the system
oh-my-posh version: 3.111.2
posh-git version: 1.0.0
Steps to reproduce:
And save as Microsoft.PowerShell_profile.ps1
![111055583-49ac3600-84b2-11eb-879b-b244d468566f](https://user-images.githubusercontent.com/45238096/111063685-0fab5600-84eb-11eb-99a7-ce611bb9e56f.png)
3. Close PowerShell, and open PowerShell again
Expected results:
PowerShell will not report errors
Actual results:
PowerShell reports an error, and the content of the error:
Warning: You appear to have an unsupported Git distribution; setting $GitPromptSettings.AnsiConsole = $false. posh-git recommends Git for Windows.
Remarks:
If you install Git v2.30.2 version, no error will be reported. I installed the 2.31.0 rc1, 2.31.0 rc0, and 2.30.0 rc2 versions, and all encountered this problem. I installed the 2.30.1 and 2.30.2 version again and did not encounter this problem. After I reported this problem in Git, I was told that it was a posh-git problem. Please see: git-for-windows/git#3111 (comment)
The text was updated successfully, but these errors were encountered: