Reputation: 304
Background: We recently added a branch to a git project to support development of a new feature. We'll call the branch newfeature. For local development we continue to use the same directory structure for code, simply switching between master and newfeature with the git checkout branchname
syntax. All is well and good.
Now for the problem. Using the git plugin (2.1.0_1) in Hudson (2.1.1) configuring it to poll and build only the newfeature results in ERROR: Nothing to do
. Config seemed quite simple, plug in the git repository url as usual and then simply specify newfeature in the Branches to build field. I know that there are a lot of Advanced options for the git plugin but it isn't immediately clear that any would resolve this problem. I've even played with the advanced Merge options settings to no avail.
We aren't trying to do anything flashy, we don't need to build and then push and merge back to the repo. We simply want to have a separate Hudson project that polls and builds only the newfeature git branch.
What am I missing?
Upvotes: 1
Views: 686
Reputation: 61
If you're running on Windows+Cygwin, you need to be careful with your environment when using Git. Or at least the version of Git supplied with Cygwin.
We had noticed that our CYGWIN
environment variable was set to "tty". This appears to cause problems with various git commands, most noticeably for us git branch
and git rev-parse
.
For example, when running git branch
at the Windows command prompt, this is the behavior we were seeing:
C:\gittest>git branch
* master
C:\gittest>set CYGWIN=tty
C:\gittest>git branch
C:\gittest>
Notice that after setting CYGWIN=tty
, the git branch
command no longer returns any output.
So, if you're running Hudson on Windows, and using Git from Cygin, check to see if you have your CYGWIN
environment variable set. Hudson allows you to configure build-time environment variables, in case you need to override a system-wide setting.
Upvotes: 1