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

Git for Windows installer option to use OpenSSH breaks git-lfs #5746

Open
ThinkChaos opened this issue May 13, 2024 · 1 comment
Open

Git for Windows installer option to use OpenSSH breaks git-lfs #5746

ThinkChaos opened this issue May 13, 2024 · 1 comment

Comments

@ThinkChaos
Copy link

Describe the bug

The Git for Windows installer has an option to use OpenSSH. This sets GIT_SSH to C:/Windows/System32/OpenSSH/ssh.exe.
In git-lfs' custom subprocess logic, / is not recognized as a path separator, and thus it tries to find an exe with that name in PATH.

(Arguably it's a bug in Go oversimplifying things: os.PathSeparator is misleading as there's more than one separator on Windows, but that ship has sailed... See I want off Mr. Golang's Wild Ride for more fun gotchas.)

To Reproduce

  1. set GIT_SSH=C:/Windows/System32/OpenSSH/ssh.exe
  2. Try to use LFS

Error snippet:

batch request: executable file not found in %PATH%
error: failed to fetch some objects from '[...].git/info/lfs'

Workaround: set GIT_SSH=C:\Windows\System32\OpenSSH\ssh.exe
(or in the Windows environment variable settings for system wide fix)

Expected behavior

No error.

System environment

Git for Windows

Output of git lfs env

git-lfs/3.5.1 (GitHub; windows amd64; go 1.21.7; git e237bb3a)
git version 2.45.0.windows.1

[...]
GIT_SSH=C:/Windows/System32/OpenSSH/ssh.exe
[...]
@chrisd8088
Copy link
Contributor

Hey, thanks for the report! I've marked this as a Windows bug and put it into our backlog.

One thing for us to keep in mind is that we might remove our custom executable-lookup logic, now that it's no longer needed (see #5612), and so anything we do to try to resolve this problem should, ideally, avoid introducing more custom logic into that code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants