views:

106

answers:

1

I'm setting up my first Hudson + Git project (previously done many with Hudson + SVN). I expected the clone stage to be slow, as our repository is quite large, but subsequent builds where a fetch + merge is being used are just as long. The following options are enabled:

  • Merge before build
  • Clean after checkout

I am not doing a "Wipe out workspace".

...
Fetching changes from the remote Git repository
Fetching upstream changes from [email protected]:username/ProjectFoo.git
[Foo] $ git fetch -t [email protected]:username/ProjectFoo.git +refs/heads/*:refs/remotes/origin/*

At this point it stalls for a very long time. Once it finally finishes, it appears to progress as expected:

[Foo] $ git ls-tree HEAD
[Foo] $ git rev-parse origin/mybranch
Commencing build of Revision c883d59dd5a506a0b586f679a256f539712bfccc (origin/mybranch)
GitAPI created
Checking out Revision c883d59dd5a506a0b586f679a256f539712bfccc (origin/mybranch)
[Foo] $ git checkout -f c883d59dd5a506a0b586f679a256f539712bfccc
[Foo] $ git tag -a -f -m "Hudson Build #2" hudson-Foo-2
Recording changes in branch origin/mybranch
[Foo] $ git whatchanged --no-abbrev -M --pretty=raw c883d59dd5a506a0b586f679a256f539712bfccc..c883d59dd5a506a0b586f679a256f539712bfccc
Cleaning workspace
[Foo] $ git clean -fdx
...

When I run the same fetch command from the Git Bash command line, it runs almost instantaneously.

Any idea what might be going on? Or hints to speed things up? Note, the cloned repository is 210MB. (About a decade's worth of code history.)

+1  A: 

Could you try an anonymous access instead of an authenticated one for your fetch?

$ git config remote.origin.url git://github.com/username/ProjectFoo.git   # read-only
$ git config remote.origin.pushurl [email protected]:username/ProjectFoo.git # authenticated

and see if the fetch is still slow within the Hudson job?

See for illustration "Using Github with MsysGit".

VonC
Given the way the client has the repo setup (it's proprietary) we have to have authentication each way (AFAIK). That said, I didn't know you could have different push/pull URLs. That's cool.I should clarify that all of this works completely fine if I do it manually from the cmd.exe environment.... I'm suspecting the Hudson git-plugin at this point, which, if I understand correctly, does *not* use the MsysGit installation.
Simeon Fitch