Skip to content
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

better git path handling #865

Merged
merged 5 commits into from
Apr 8, 2016
Merged

Conversation

jankatins
Copy link
Contributor

This PR contains three two main commits

@@ -41,6 +41,8 @@ try {
# Check if git is on PATH, i.e. Git already installed on system
Get-command -Name "git" -ErrorAction Stop >$null
} catch {
$env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\cmd")
# for bash.exe, which in the cmd version is found as <GIT>\usr\bin\bash.exe
$env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\bin")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure if this is a nice thing to keep the ...\bin version: the problem is that if the user has added git to the path (via the git for windows installer), then bash is not found as the installer does not add bin to the path.

IMO both version should result in the same apps visible in path... Not sure how to ensure that, probably by setting GIT_INSTALL_PATH and then unconditionally adding the bin path?

@daxgames
Copy link
Member

daxgames commented Mar 4, 2016

I did add it to mine.

@jankatins
Copy link
Contributor Author

Updated and repushed

@MartiUK
Copy link
Member

MartiUK commented Mar 17, 2016

Could you resync, your branch again? Thanks.

The idea is:
* if the users points as to a specific git, use that
* test if a git is in path and if yes, use that
* last, use our vendored git

We don't make any attempt to guess a different location, if a user wants their
own git install, they have to choose "add git to path".

Also check that we have a recent enough version of git (e.g. test for
<GIT>\cmd\git.exe)
Some unix commands shadow windows commands and therefor the unix commands should
be at the end of the PATH
The only reason was bash but bash.exe is also in <GIT>\usr\bin.
This ensures that the "normal" path entry (cmd) is first and bash is still reachable via the bin path.
@jankatins
Copy link
Contributor Author

Updated, sorry for the long delay, seems I missed the rebase request.

@Stanzilla Stanzilla merged commit 7eb7255 into cmderdev:development Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants