How can I configure plink.exe to be verbose when run by git?
The problem: on windows, using the command git.cmd clone git+ssh://user@host/repo folder
when GIT_SSH=plink.exe
intermittently fails across build slaves. I need to find the root cause, and make connections reliable, without retrying on some count.
I've narrowed down that sshd is running and terminating its processes without error. The server is running gitosis, so I only have command line output to go on. When the failure happens, gitosis doesn't get called (no gitosis prints), so I'm suspecting the windows ssh client.
I want to connect with verbose logging when plink.exe is invoked by git.
Setting GIT_SSH=plink.exe -v
results in:
error: cannot spawn plink.exe -v: No such file or directory
Turns out, GIT_SSH must be an executable or wrapper script.
Creating such a batch file wrapper gets closer: GIT_SSH=C:\path\to\plink.cmd
where plink cmd is plink.exe -v %*
prints expected verbose logging to console, but terminates unsuccessfully with error code 128. The cloned folder is never created, and the last printed console output is:
Unable to write to standard output: The pipe is being closed.
How can I get the verbose client log at the time of failure from plink?
Pull the source code from
svn://svn.tartarus.org/sgt/putty
, build the windows make files from a Visual Studio 2010 command prompt in the root dir usingperl mkfiles.pl
, and then build everything withnmake -f Makefile.vc
.Find a good place to make a local edit in
winplink.c
main() function. I put mine right before the arg processing loop.The "Plin" error is actually the first 4 characters of the returned error message from the Git server. Typically the account name passed in from 'echo %USERNAME%' when using plink.exe to provide the password.
We found the intermittent errors being related to inconsistent mapping of usernames to the GIT userlist. We ended up standardizing all the Git usernames in Uppercase. and the problem went away.
This problem affected many users across many Git branches.