Announcing new plugin: rake_commit_tasks

written by paul on June 10th, 2008 @ 11:20 PM

The last few projects I’ve been on have had a “rake commit” task for checking in. This is documented at Jay’s blog: Ruby: rake commit

Each project has improved upon these tasks. As a result, I thought it would be handy to create a plugin that projects can start with and contribute to. Though the tasks are about subversion, I started a project on github for better collaboration: http://github.com/pgr0ss/rake_commit_tasks

I started with the code at Jay’s blog and added some stuff from my last few projects:
  • Use readline instead of gets so you can use the arrow keys and backspace
  • Break if there are conflicts in svn up
  • Don’t add result of conflicts to subversion (.mine, etc)
  • Check cc.rb and prompt if build is failing

Comments and patches are welcome.

Comments

  • Josh on 12 Jun 09:18

    Sounds like an awesome idea paul. I just thought I would share the way we used the commit task on my last project (it was java with an ant build, but same principles apply.) Our project had an unforutnately long build. 20 to 30 minutes just to run tests. That end of day checkin was always a risk, because often you didn't have time to run tests before you ran to catch your train so you could either checkin and risk a broken build that you would have to fix remotely when you got home, or you could miss your train waiting for tests before you checked in (the preferred, but more painful choice). Obviously the real fix is to have a faster test suite, but another thing we did was to hook our commit task into a task called time_to_checkin. That task would do an svn update, clean, compile, force-checkstyle (in case you had disabled it), force-jsp-compile (in case you had disabled that too), run tests, commit. The force-checkstyle and jsp-compile was key because we had properties in build.properties called no-jsp and no-checkstyle that were useful to make your development cycle faster, but dangerous if you forgot to run those things before commit. time_to_checkin always kept it real.

Post a comment

Options:

Size

Colors