{"action":"created","issue":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/1421","labels_url":"https://api.github.com/repos/capistrano/capistrano/issues/1421/labels{/name}","comments_url":"https://api.github.com/repos/capistrano/capistrano/issues/1421/comments","events_url":"https://api.github.com/repos/capistrano/capistrano/issues/1421/events","html_url":"https://github.com/capistrano/capistrano/issues/1421","id":70142328,"number":1421,"title":"Use GIT_SSH_COMMAND instead of GIT_SSH","user":{"login":"psharpNumerex","id":1760457,"avatar_url":"https://avatars.githubusercontent.com/u/1760457?v=3","gravatar_id":"","url":"https://api.github.com/users/psharpNumerex","html_url":"https://github.com/psharpNumerex","followers_url":"https://api.github.com/users/psharpNumerex/followers","following_url":"https://api.github.com/users/psharpNumerex/following{/other_user}","gists_url":"https://api.github.com/users/psharpNumerex/gists{/gist_id}","starred_url":"https://api.github.com/users/psharpNumerex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psharpNumerex/subscriptions","organizations_url":"https://api.github.com/users/psharpNumerex/orgs","repos_url":"https://api.github.com/users/psharpNumerex/repos","events_url":"https://api.github.com/users/psharpNumerex/events{/privacy}","received_events_url":"https://api.github.com/users/psharpNumerex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-22T14:27:05Z","updated_at":"2015-04-22T14:56:50Z","closed_at":null,"body":"If the `application` or `:tmp_dir` variables contain the string 'plink', then git will add `-branch` to the args for a `git` command.\r\n\r\nThis is a poorly documented 'feature' of git to add support for putty, but it causes `getaddrinfo` errors on Ubuntu when it tries to use `-branch` as the host.\r\n\r\n`GIT_SSH_COMMAND` takes precedence over `GIT_SHH`, however.\r\n\r\nCurrently, I can work around this by simply changing the name of the application variable, but this is not ideal.\r\n\r\nThere are differences in how the two variables are treated, so a good alternative might be to be able to set the entire `git_ssh.sh` path in a variable."},"comment":{"url":"https://api.github.com/repos/capistrano/capistrano/issues/comments/95221312","html_url":"https://github.com/capistrano/capistrano/issues/1421#issuecomment-95221312","issue_url":"https://api.github.com/repos/capistrano/capistrano/issues/1421","id":95221312,"user":{"login":"leehambley","id":18952,"avatar_url":"https://avatars.githubusercontent.com/u/18952?v=3","gravatar_id":"","url":"https://api.github.com/users/leehambley","html_url":"https://github.com/leehambley","followers_url":"https://api.github.com/users/leehambley/followers","following_url":"https://api.github.com/users/leehambley/following{/other_user}","gists_url":"https://api.github.com/users/leehambley/gists{/gist_id}","starred_url":"https://api.github.com/users/leehambley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leehambley/subscriptions","organizations_url":"https://api.github.com/users/leehambley/orgs","repos_url":"https://api.github.com/users/leehambley/repos","events_url":"https://api.github.com/users/leehambley/events{/privacy}","received_events_url":"https://api.github.com/users/leehambley/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T14:56:50Z","updated_at":"2015-04-22T14:56:50Z","body":"First citation: http://man7.org/linux/man-pages/man1/git.1.html\r\n\r\n```\r\nGIT_SSH, GIT_SSH_COMMAND\r\n           If either of these environment variables is set then git fetch\r\n           and git push will use the specified command instead of ssh when\r\n           they need to connect to a remote system. The command will be\r\n           given exactly two or four arguments: the username@host (or just\r\n           host) from the URL and the shell command to execute on that\r\n           remote system, optionally preceded by -p (literally) and the port\r\n           from the URL when it specifies something other than the default\r\n           SSH port.\r\n\r\n           $GIT_SSH_COMMAND takes precedence over $GIT_SSH, and is\r\n           interpreted by the shell, which allows additional arguments to be\r\n           included.  $GIT_SSH on the other hand must be just the path to a\r\n           program (which can be a wrapper shell script, if additional\r\n           arguments are needed).\r\n\r\n           Usually it is easier to configure any desired options through\r\n           your personal .ssh/config file. Please consult your ssh\r\n           documentation for further details.\r\n```\r\n\r\nAnd, the second: https://github.com/git/git/blob/7c597ef345aed345576de616c51f27e6f4b342b3/connect.c#L747-L756\r\n\r\n```\r\nssh = getenv(\"GIT_SSH_COMMAND\");\r\nif (ssh) {\r\n\tconn->use_shell = 1;\r\n\tputty = 0;\r\n} else {\r\n\tssh = getenv(\"GIT_SSH\");\r\n\tif (!ssh)\r\n\t\tssh = \"ssh\";\r\n\tputty = !!strcasestr(ssh, \"plink\");\r\n}\r\n```"}}