in

CodePrairie .NET

South Dakota .NET User Group

chrisortman

Why frequent commits are important

Something I have noticed has changed about the way I work now that I use git instead of subversion is that I make a lot more commits.

Let's say that in order to add feature X I need to make the following changes

Add migration
Add ActiveRecord model Foo
Add PersistanceTests for model
Write Tests for feature X
Rename an existing class
Change the way some other model class works
implement some behavior in Foo
Ensure that tests pass

In a lot of code I've seen all these changes would be grouped into a single SVN commit

svn commit -m "Implemented feature X"

But when that is the case a lot of information gets lost about how feature X got implemented.

I think that each of those changes should be their own commit with their own explanation. Centralized version control doesn't help this though because I would get impatient with making 3 minutes worth of changes and waiting 30 seconds to make the commit. I also think that pushing each change out to everyone else before the whole feature is ready would be a bad thing.

Using a DVCS (such as git) it is painless to do this. The commits are fast, and I just because I commit doesn't mean I need to share. I also have the freedom to go back and rewrite history if I realize while I'm implementing some behavior in Foo that I forgot a column that should have been part of my initial migration.

Published Feb 14 2008, 07:40 AM by chrisortman
Filed under: ,

Comments

No Comments

Leave a Comment

(required)
(optional)
(required)
Add
Powered by Community Server (Commercial Edition), by Telligent Systems