djinncoyote (
djinncoyote) wrote2015-07-23 11:50 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Eclipse Mars + eGit
I have a Windows 7 computer with Git installed.
In both Eclipse Kepler and Eclipse Luna, when I open Preferences - Team - Git - Configuration, and select the System Settings tab, there is a Browse button which lets me select my Git install folder. Selecting this folder causes the page to be automatically updated with the Git system-wide settings.
In Eclipse Mars, there is no Browse button, and the other buttons are disabled, so I can't load the Git system-wide settings. It seems like a bug. Has anyone else had this problem?
The Mars version of the Eclipse Help, like the prior versions, still indicates that there should be a Browse button:
My user settings are picked up okay from my %HOMEDRIVE%\%HOMEPATH% folder. I've tried defining a HOME environment variable, but that made no difference. The Browse button was still missing.
I tried adding my Git folder to my PATH, and that made no difference either. But now I don't remember if I had added the install folder or the bin folder to my PATH... I suppose I can do that test again.
Update: A workaround for the problem is to put your Git bin folder in your PATH environment variable. See comment below.
In both Eclipse Kepler and Eclipse Luna, when I open Preferences - Team - Git - Configuration, and select the System Settings tab, there is a Browse button which lets me select my Git install folder. Selecting this folder causes the page to be automatically updated with the Git system-wide settings.
In Eclipse Mars, there is no Browse button, and the other buttons are disabled, so I can't load the Git system-wide settings. It seems like a bug. Has anyone else had this problem?
The Mars version of the Eclipse Help, like the prior versions, still indicates that there should be a Browse button:
If you use Git for Windows as a companion to EGit, make sure EGit knows where Git is installed so it can find the "system wide settings", e.g. how core.autocrlf is set. Go to the settings and look under Team>Git>Configuration and then the System Settings tab.
If you selected one of the options to use Git from the Command Line Prompt when you installed Git for Windows, then the location of the system wide settings is filled in with a path and everything is fine. If not, use the Browse button to locate where Git is installed, e.g. C:\Program Files(x86)\Git.
My user settings are picked up okay from my %HOMEDRIVE%\%HOMEPATH% folder. I've tried defining a HOME environment variable, but that made no difference. The Browse button was still missing.
I tried adding my Git folder to my PATH, and that made no difference either. But now I don't remember if I had added the install folder or the bin folder to my PATH... I suppose I can do that test again.
Update: A workaround for the problem is to put your Git bin folder in your PATH environment variable. See comment below.
no subject
no subject
I wouldn't be surprised if someone misguidedly decided there was no need for a Browse button as everyone who uses Git should have it in their PATH. I'm tempted to pull the source code to look at it...
So I did. The logic for the Browse button was removed from module ConfigurationEditorComponent.java in this EGit commit with comment,
"Follow up on commit d7a447 in jgit which removed gitprefix logic and broke egit compile."
The corresponding jgit commit states: "The only purpose of the gitprefix logic was to determine the path to the system-wide config file. This is now done by discoverGitSystemConfig() independent of the gitprefix, so get rid of this unused code."
And another related jgit update states:
"Now that d7a4473 removed the gitprefix property, we did not have a way to specify the path to the Git system config file in case discoverGitSystemConfig() fails. Fix that by introducing a member variable that caches the result of discoverGitSystemConfig() as well as a setter method to overwrite the content of that variable."
Can't say that I understand all of that. But I'm satisfied that the button wasn't simply removed on a whim.
no subject
https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java
and that it basically calls discoverGitExe() and then calls Git with "config --system --edit" to see what comes back.
discoverGitExe is specific for each file system type. For Win32 it checks the Path:
https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java
So if Git is in your PATH environment variable then it should find it automatically and pick up your standard settings.
no subject
It looks like the original egit logic set the gitprefix variable based on the folder you manually selected via the Browse button. As jgit removed the variable, egit had to remove the Browse option, ie. the ability to manually select the path. So that now forces Windows/Eclipse Mars/Egit users to include it in their PATH variable.