Monday, 28 November 2011

Don't be a fiend, commit often.

You must know this pain. 

 

hg commit -Am "Massive commit of whole days work"

hg push

TIME FOR MERGING HELL! PREPARE YOUR ANUS!

 

As a comparison, merging tool we use Beyond Compare. Indeed it's not a bad tool. But it's not clairvoyant. No tool can completely remove headaches that are generated from both the above message and also rolling back from changes that have been commited. 

As mentioned, one of the boons of source control is the rolling back of changes if needed. I think this can be made difficult when you are checking in a ton of work at once from all sorts of little fixes, changes, tweaks and implemented functionality. 

My dream is to commit work discretely by feature. For example in CRUD land. You would discretely check in the create mechanism, view mechanism and so on. If you see small bugs elsewhere, write them down. Fix them in their own seperate commit afterwards (or before depending on the situation). 

I like breaking work down into features (what some people like to call requirements) that can then be tested, implemented and commited discretely. You can then have commit messages like; 

 

hg commit -Am "As an admin user you can now add customers to a business account"

 

When looking at the repository you can then see a nice development of features and how / when they were implemented. 

I'm not saying I do this all the time. It's what I aspire to do. I can still be a fiend to not commiting discretely and also nipping little bits and bobs in. But the more you try to do this, the better your life will be. 

1 comment:

Dom Finn said...

Yeah the csproj can be a real pain but just in general, the more you have to manually merge the greater the chance is of a cock up. I just feel a cold sweat every time Beyond Compare reveals it's ugly head.

Comments System

Disqus Shortname