git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] having 'plink' anywhere in the GIT_SSH environment variables sets putty = true

From
Patrick Sharp <jakanapes@gmail.com>
Date
Apr 23, 2015, 13:15 UTC
Message-ID
<317B332E-CA9A-4B6B-A0C4-7202CBF5C1AA@gmail.com>
In-Reply-To
<55387E31.5010100@web.de>
Torsten,
The relevant part of the path in GIT_SSH was ‘/uplink_deploy/‘.
I did begin to use GIT_SSH_COMMAND as a workaround, but regardless this still feels like an overly broad way to determine the value of the putty flag.
I was kind of surprised to find it being inferred from the value of GIT_SSH instead of being explicitly set by some additional variable.  GIT_USE_PUTTY or some such, though I can understand there may be some reluctance to put the onus of that on the end user.
Part of the issue stemmed from not being able to find any documentation on this.  After I discovered what was happening I found plenty of instructions that indicated to enable putty support set GIT_SSH to /path/to/plink.exe, but I didn’t find it stated anywhere that if ‘plink’ was found in GIT_SSH, then git will add the -batch option to the command args.  In other words, I was able to find instructions on what to do if we had been using putty, but not instructions on unexpected behavior if using GIT_SHH while NOT using putty.
Show 37 quoted lines
> On Apr 23, 2015, at 12:08 AM, Torsten Bögershausen <tboegi@web.de> wrote:
> 
> On 04/22/2015 09:12 PM, Patrick Sharp wrote:
>> Johannes,
>> 
>> You’re correct, looking back over it, I was pretty vague.
>> 
>> In truth, we are not using Windows OR putty at all.  Running git on an Ubuntu system, but we are setting the GIT_SSH environment variable to point to a shell script to use.
>> 
>> Upon attempting to run git ls-remote, the system was spitting out getaddrinfo errors for ‘atch’ .
>> 
>> Setting GIT_TRACE=2 showed that -batch was being added to the git command.
>> 
>> This was seen on several different servers with git versions 1.8.5.2, 1.9.1 and 2.3.5
>> 
>> After a bit we realized that it was the string ‘uplink’ in the GIT_SSH variable that was linked to the extra -batch flag.
>> 
>> Finally, after searching the git source, we narrowed it down to the ‘plink’ portion of the string.
>> 
>> https://github.com/git/git/blob/7c597ef345aed345576de616c51f27e6f4b342b3/connect.c#L747-L7
> Brian, I got your patch,
> but can't see it in the list yet
> 1/2 looks good, thanks.
> (And add msygit)
> 
> My feeling is that  patch 2/2 may break things for an unknown
> amount of users which e.g. use "myplink".
> 
> Patrick,
> did you ever tell us, what you put into $GIT_SSH ?
> 
> Can your use case be covered by using $GIT_SSH_COMMAND ?
> 
> 
> 
> 
> 
Previous: Torsten Bögershausen
Message 41 of 41 in “[BUG] having 'plink' anywhere in the GIT_SSH environment variables sets putty = true”
  1. Patrick SharpApr 22, 2015
  2. Johannes SchindelinApr 22, 2015
  3. Patrick SharpApr 22, 2015
  4. Jeff KingApr 22, 2015
  5. brian m. carlsonApr 22, 2015
  6. Jeff KingApr 22, 2015
  7. brian m. carlsonApr 22, 2015
  8. Jeff KingApr 22, 2015
  9. brian m. carlsonApr 22, 2015
  10. Jeff KingApr 22, 2015
  11. 1/2 connect: simplify SSH connection code pathbrian m. carlson, Apr 23, 2015
  12. 2/2 connect: improve check for plink to reduce false positivesbrian m. carlson, Apr 23, 2015
  13. Johannes SchindelinApr 23, 2015
  14. Jeff KingApr 23, 2015
  15. brian m. carlsonApr 23, 2015
  16. Johannes SchindelinApr 24, 2015
  17. 1/2 connect: simplify SSH connection code pathbrian m. carlson, Apr 24, 2015
  18. 2/2 connect: improve check for plink to reduce false positivesbrian m. carlson, Apr 24, 2015
  19. Pete HarlanApr 24, 2015
  20. brian m. carlsonApr 24, 2015
  21. Torsten BögershausenApr 25, 2015
  22. brian m. carlsonApr 26, 2015
  23. 0/3 Improve robustness of putty detectionbrian m. carlson, Apr 26, 2015
  24. 1/3 connect: simplify SSH connection code pathbrian m. carlson, Apr 26, 2015
  25. 2/3 t5601: fix quotation error leading to skipped testsbrian m. carlson, Apr 26, 2015
  26. 3/3 connect: improve check for plink to reduce false positivesbrian m. carlson, Apr 26, 2015
  27. Johannes SchindelinApr 27, 2015
  28. Jeff KingApr 28, 2015
  29. Jeff KingJun 26, 2015
  30. Junio C HamanoJun 26, 2015
  31. Jeff KingJun 26, 2015
  32. Johannes SchindelinJun 26, 2015
  33. Jeff KingJun 26, 2015
  34. brian m. carlsonJun 26, 2015
  35. Junio C HamanoApr 26, 2015
  36. Torsten BögershausenApr 27, 2015
  37. Jeff KingApr 28, 2015
  38. brian m. carlsonApr 29, 2015
  39. Johannes SchindelinApr 24, 2015
  40. Torsten BögershausenApr 23, 2015
  41. Patrick SharpApr 23, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.