Good commits come in small sizes......
Dr Dobbs Journal has a great post in praise of small commits. As Jeff Ma points out, small commits have multiple benefits -
- Smaller commits = Less code complexity = easier to understand = easier to test and debug
- Smaller commits = faster code reviews = quicker feedback from reviewers
- Quicker feedback from reviewers = less (mental) context switching for the developer
As Jeff says -
In a continuous integration environment, the speed at which commits are tested, added to the build, and possibly reverted is paramount. Builds are also faster for small commits because they are, by nature, smaller. Faster and more frequent builds translates into getting the product out faster and getting feedback more quickly. And because the commit is small, if you need to revert back to an earlier version of a build, that is also easier to do. An added benefit is that if you need to remove a commit that has a small scope of functionality, only that piece needs to be removed from the build, which leaves other features intact.
You can check out how Shippable can help you #shipcodefaster!