How often do you commit?

I was working on some code today and was getting ready to do a check in and I thought to myself, should I be checking this code in? I made tiny change that would end up being part of a bigger refactoring of some tests I was writing, I wasn’t sure if I would be working on the refactoring again in the short term so I figured I would check in what I had done, even though the unit of work was small, it was done and left the project in a running valid state.

The longer you wait, the more painful it will be
Kinda like ignoring that aching tooth, or that tweak in your back, it can wait it’s not that serious right now is it? I’ve seen much of the same attitude when it comes to working with source control systems. Developers will work on a task and not check in any of there changes for sometimes weeks. This often time’s leads to code conflicts and merging tasks because the developer waited so long to check in.

Check in early, check in often
The project I am working on at the moment is a small wrapper for the 37 Signals backpack api. It’s just me working on it right now so conflicts are unlikely, but i still check in any work that i have done when I leave the application in a valid state, even if the complete task isn’t done. For me it feels like the right thing to do, I can be sure that the repository is always in a state that works (if someone else ever felt like contributing) and it also helps me sleep at night knowing that if for some reason my laptop decided to off itself during the night, my project is still there ready and waiting for me.

This entry was posted in development, personal, software, work. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>