-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Pass SSH_AUTH_SOCK variable for ssh authentication while cloning repo… #118
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
Conversation
@@ -91,10 +91,14 @@ class Git { | |||
} | |||
|
|||
do { | |||
var environment = [String:String]() | |||
if let sshAuthSockPath = getenv("SSH_AUTH_SOCK") { //for auto ssh authentication if possible | |||
environment["SSH_AUTH_SOCK"] = sshAuthSockPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also other env variables that might be nice to replicate.
GIT_ASKPASS
(git-credentials)SSH_ASKPASS
XDG_CONFIG_HOME
(used forgit-credenitials
lookup)
In which, I wonder why not just inherit all environ variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a conversation about inheriting all variables here : https://bugs.swift.org/browse/SR-588
I think we intentionally want to limit the variables in some places (during builds), but when we are talking to a third party tool like git, I agree we should probably default to inheriting the full process environment. |
ok, I can convert this to inherit the full list. |
We are only going to be able to do this via C, unfortunately. What we could do is try and get environ support added to the Swift stdlib (in the Process enum, next to the arguments fields). If someone wanted to push that through, its a good addition for everyone and then we can just use it. |
You'd also want to inherit various environment variables that set the locale. Git is localized to many languages. |
@gribozavr can you point us at a list? |
All Passing through And we also want to pass through |
Thanks, will apply. |
what is preferable? copying entire environ or only useful subset ? |
It is preferable to copy as little as possible as the environment can have unforeseen consequences on the execution of tools. |
is @swift-ci is only available for main swift repo? |
In the meanwhile, updated to pass list of envs commented here |
Post my refactor this needs to be merged, I am happy to do the merge, since I caused the problem, let me know. |
@mxcl Done |
Pass SSH_AUTH_SOCK variable for ssh authentication while cloning repo…
…mputation [BuildSystem] Fix bug where directory contents were always recomputed.
…s - SR-561
https://bugs.swift.org/browse/SR-561