Anthony Newnam wrote:
> > > > > I am attempting to use msysgit with Hudson. The git plugin works
> > > > > correctly, but it isn't going through an msysgit shell (I believe) and
> > > > > just running git.cmd. If I try to run any git commands myself, the
> > > > > hang indefinitely.
> > [...]
> > > > Are you attempting to clone using the SSH transport?
> > > > Then the ssh client might ask you to accept the target host's
> > > > fingerprint or provide a password.
> >
> > > Yes, I am using SSH. If I run the same command from the same user
> > > interactively, it works without any prompting. The host is in my
> > > ~/.ssh/known_hosts, and my public key is already in the server.
> >
> > > I suspect that you are correct about what it is doing, but I don't
> > > know why it would do it. Would there be some reason for msysgit to not
> > > see my key or known_hosts when it is run as a service?
[...]
> > Also msysgit can be traced to some extent using the GIT_TRACE env.
> > variable (set to 1).
[...]
> I set GIT_TRACE:
>
> + export GIT_TRACE=1
> + GIT_TRACE=1
> + git fetch
> trace: built-in: git 'fetch'
> trace: run_command: 'ssh' '-p' '29418' 'gerrit.domain.tld' 'git-upload-
> pack '\''/base'\'''
> trace: run_command: 'rev-list' '--quiet' '--objects' '--stdin' '--not'
> '--all'
> (a little lag here)
> trace: run_command: 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-
> pack 1416 on localhost' '--pack_header=2,199410'
> trace: built-in: git 'index-pack' '--stdin' '--fix-thin' '--keep=fetch-
> pack 1416 on localhost' '--pack_header=2,199410'
>
> and then it hangs indefinitely (although without the trace, I've let
> it run for hours).
Unfortunately, this requires a Git expect (which I'm not) to
understand.
My stab at this follows nonetheless.
As I understand, git-index-pack is called on the stream of objects
(a "pack") sent by the git-upload-pack process running on the server
side,
and it's supposed to create an index file for this pack and quit.
Then the pack will be shoveled into the local object store.
So I can see two possibilities here:
1) For some reason, git-upload-pack on the remote side does not
complete
and hence git-index-pack --stdin waits forever for the end of its
stream.
2) You have hit some bug in Git/msysgit which makes the git-index-pack
process
to lock up (or enter an endless loop or whatever).
Hence now I'd check the status of the involved processes after git-
index-pack hangs.
If you have access to the server side, check if there's a git-upload-
pack process running/sleeping.
Check if the local SSH process has its TCP stream open (Process
Explorer or tcpview from Sysinternals would do). If possible, attach
to git-index-pack using windbg and get its stack trace -- supposedly
this could tell if it's blocked in a syscall reading from stdin or
not.
I hope someone more knowledgeable will suggest more ideas to try out.