Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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;
share|improve this answer
    
Now I can see that git 1.8 + plink 0.62 on the client is failing intermittently with "fatal: protocol error: bad line length character: plin". But it's succeeding about 85% of the time. Keep hacking and logging to a file, I guess. :( –  Epu Mar 8 '13 at 0:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.