gitextensions / gitextensions

Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
https://gitextensions.github.io/
Other
7.76k stars 2.08k forks source link

Repair git version on windows #11395

Open ghost opened 11 months ago

ghost commented 11 months ago

Feature description

The latest version requires git 2.42. image The repair button only show the path of the git.exe file

My suggestion is that the Repair button tries to upgrade git directly using this command:

git update-git-for-windows

and for older versions

git update

https://stackoverflow.com/a/48924212

Environment

    Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
vbjay commented 11 months ago

Frankly I think it is something ge should not do. Us telling you git is out of version support and with things like chocolatey that allow you to manage software versions including git and wsl vs git for windows. Because git may be wsl vs git for windows. I don't like this idea. I'd rather alert the developer to the issue and let the developer manage git.

trojanobelix commented 11 months ago

But then the button shouldn't be labled as "repair" if it doesn't

vbjay commented 11 months ago

https://github.com/vbjay/gitextensions/blob/master/GitUI/CommandsDialogs/SettingsDialog/CheckSettingsLogic.cs#L153

Understand what repair does. It tries to find git path setting to tell ge where git is installed. That setting page even has a link to download git install.

ghost commented 11 months ago

Yes it's confusing with "Repair" from a user perspective. The code you linked to and the error message are not correlating.

I assumed that if git update-git-for-windows works then one can be sure that it does the right thing. Not interfering with WSL or chocolatey which wouldn't have that command parameter in its git edition.

If one is using chocolatey they would probably install git extensions that way to get matching versions without risking these incompatibility warnings.

trojanobelix commented 11 months ago

Understand what repair does. It tries to find git path setting to tell ge where git is installed. That setting page even has a link to download git install.

The picture with the settings above clearly says "git found"!!! Why is it then necessary to determine the path? This is not clear to me.

gerhardol commented 11 months ago

But then the button shouldn't be labled as "repair" if it doesn't

It opens the settings page so you can repair the setting. GE cannot know what path a user will use or how to update Git in all situations.

The picture with the settings above clearly says "git found"!!! Why is it then necessary to determine the path? This is not clear to me.

You may use a portable Git install with another path than the standard.

git update-git-for-windows could be called (for instance with a popup), but will fail if the user has no admin privileges etc and is a potential issue in its self (like interfering with choco). A link should be enough for most users.

vbjay commented 11 months ago

You may use a portable Git install with another path than the standard.

or wsl git. Try running that command in wsl git.
image image