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

Do not force-set HOME variable, let nsswitch decide #26

Merged
merged 1 commit into from
Jun 21, 2018
Merged

Do not force-set HOME variable, let nsswitch decide #26

merged 1 commit into from
Jun 21, 2018

Conversation

nathanhi
Copy link

Previous versions of Git/msys1 did not check for the
correct location of the user profile on Windows, thus
requiring the HOME variable to be set. Since Git 2 nsswitch
is used to identify the correct location of the user profile.

For non-roaming domain userprofiles, where USERPROFILE still
remains on drive C:, but with an additional home drive set,
this line breaks search for the SSH key, since nsswitch returns
the correct results, but HOME is used instead, since it has been
already set by start-ssh-agent.cmd.

Previous versions of Git/msys1 did not check for the
correct location of the user profile on Windows, thus
requiring the HOME variable to be set. Since Git 2 nsswitch
is used to identify the correct location of the user profile.

For non-roaming domain userprofiles, where USERPROFILE still
remains on drive C:\, but with an additional home drive set,
this line breaks search for the SSH key, since nsswitch returns
the correct results, but HOME is used instead, since it has been
already set by start-ssh-agent.cmd.

Signed-off-by: Nathan-J. Hirschauer <nathan-jedidja.hirschauer@draeger.com>
@whoisj
Copy link

whoisj commented Jun 18, 2018

Seems reasonable to me. @SET "HOME=%USERPROFILE%" is only correct if %HOME% isn't set already, and only then if %HOMEDRIVE%%HOMEPATH% fail to resolve.

I'm not an SSH expert though, so my comments carry little weight. 😏

@dscho dscho merged commit dab3cdc into git-for-windows:master Jun 21, 2018
dscho added a commit that referenced this pull request Jun 21, 2018
This file had been modified in

	#26

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented Jun 21, 2018

Makes sense to me, too. Thank you so much for your contribution!

I updated the checksums in ed959f7 so that makepkg-mingw does not complain and error out.

dscho added a commit to git-for-windows/build-extra that referenced this pull request Jun 21, 2018
The `start-ssh-agent.cmd` script [no longer overrides the `HOME`
variable](git-for-windows/MINGW-packages#26).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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.

3 participants