Wednesday, December 2, 2009

Cruise control.rb refusing to build a project

I ran into an interesting problem at work today. I had a cruise control project that would not build the project after a commit was made. Other projects in CruiseControl.rb were working properly.

Here's the steps I used to debug:

Login to your Cruise Control box and cd to $BUILD_DIR/projects/$PROJ_NAME/work

Run the following command. This is how CC.rb figures out if updates have been made.

git log --pretty=raw --stat HEAD..origin/master
When I ran this command, I was getting "warning: refname 'origin/master' is ambiguous." returned. After some google searches, I landed upon some mailing list messages that pointed me towards the issue.

The reason git was complaining about origin/master being ambiguous was that someone created a tag named "origin/master" (the beating has been scheduled).

I had to delete this tag locally by running the following command.

git tag -d origin/master
Then I had to delete the remote branch by running the following.

git push origin :refs/tags/origin/master
Now the CC server is working properly.

Labels: , , , , , ,

Tuesday, April 21, 2009

GitHub set author/committer

I've been working with Git lately and more specifically GitHub. I noticed something odd one day. Where most commits have one author listed, these commits had both a author and a committer listed.

More specifically, the author field was the two members of the pair and the committer name was the workstation they were working on.

Example:

After playing around with it for a while, I figured out how to do it. Within a git project clone, run the following commands.

1) git config user.name = 'Workstation Perlwizard'
2) git config user.email = 'devs2@perlwizard.org'
3) export GIT_AUTHOR_NAME='Bob Smith and Betty Jones'
4) export GIT_AUTHOR_EMAIL='devs@perlwizard.org'

Both of the email addresses need to be addresses Github doesn't know about (i.e. not used to sign up for an account).

I could see using this while pairing with someone so you both get name credit for your commits.

Labels: , ,