We’re talking about version control here, but we’re also talking about productive habits. The term that is being passed around is “micro-commit,” and it is one of those concepts that we didn’t realize needed a name or a definition or an article on a blog. By Tim Ottinger.
A micro commit is a tiny commit. It consists of the changes necessary to do one tightly-scoped change. Maybe it’s just a file reformat. Maybe it’s just a variable rename. It could be the addition of one loop or one statement. It might involve a new microtest and just enough code to make it pass. … I was surprised to find out that there are people who only commit maybe once or twice a week. All their code is at the mercy of their editor’s history and at risk of being lost or damaged. It’s unnerving for me to even think that way.
Industrial Logic has included the “integration” step of the refactoring process since long before I even joined the company. The tight loop of TDD here is Red, Green, Refactor, Integrate. Integrate is at least to commit, but preferably to pull and push as well (GIT terms for updating the code in the main development branch and sending the changes back to that branch for the rest of the team to use).
The article then discusses following topics:
- Not everyone does that?
- Do one thing vs while you’re at it
- Save your game
- Better code reviews
- Why rebase works for me
- But we are in a hurry
- Late addition
When people are working with several days’ worth of code uncommitted, and they run into some unforeseen problems, they’re stuck. They have to press forward. They can’t back up and regroup. If they were to reset, they could lose hundreds of changes. Good read!
[Read More]