-
Notifications
You must be signed in to change notification settings - Fork 242
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
GitGetter.setupGitEnv() breaks sshCommand
config attribute
#299
Comments
Link to function at issue: Lines 239 to 273 in f9b50dd
|
It's disappointing that #300 has been open for years now :( Meanwhile, I managed to come up with a workaround using a conditional # ~/.gitconfig
[includeIf "gitdir:~/work/"]
path = ~/work/.gitconfig # ~/work/.gitconfig
[core]
sshCommand = "ssh -i ~/.ssh/id_work_ed25519 -o IdentitiesOnly=yes" It's now replaced by the following in my export GIT_SSH_COMMAND='ssh $(
if [[ "$(pwd)" == "$HOME"/work* ]]; then
echo "-i ~/.ssh/id_work_ed25519 -o IdentitiesOnly=yes"
fi
)' |
Thanks @msmans - it's horrible to ask everyone in the team to do this. In my case, I'm working around it for my work identity simply by making it the default one in
This fixes |
|
@soar There have been multiple closed PRs on this issue since the original report. At this point it would be more useful to open a new issue describing the symptoms you are seeing and the use case, if you are experiencing problems with the given functionality. Thanks! |
My apologies. I just realized, that it works with the newest Terraform. Thank you a lot! |
Context:
Recent versions of git (>= v2.10) support setting an SSH command via .gitconfig files. E.g., https://stackoverflow.com/a/38474137/93345 .
This is particularly useful when coupled with another somewhat recent feature of conditional config imports e.g., https://stackoverflow.com/a/36296990/93345 .
Problem:
The setupGitEnv() function in get_git.go specifies a
GIT_SSH_COMMAND
environment variable, even when an ssh key file is not explicitly set in the git repo URL via thesshkey
query parameter.When there is no query parameter for
sshkey
, theGIT_SSH_COMMAND
environment variable should be left unset. Presently, it ends up being set toGIT_SSH_COMMAND=ssh
, which breaks configuration via .gitconfig files.The text was updated successfully, but these errors were encountered: