# Git, plink, and cmd.exe: how do I set plink.exe to be verbose when used as GIT_SSH

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?

-
I see that the source is available. I'm going to turn on verbose output by default and see if that just works without the cmd wrapper. –  Epu Mar 4 '13 at 19:59

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 using perl mkfiles.pl, and then build everything with nmake -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.
flags |= FLAG_VERBOSE;