Atomic commit: Difference between revisions

Content deleted Content added
m Reverted 1 edit by 103.83.145.44 (talk) to last revision by Devourer09 (TW)
See also: I assume that the author intended to use "through" rather than "though". I added the missing 'r'
Line 45:
The greater understandability comes from the small size and focused nature of the commit. It is much easier to understand what is changed and reasoning behind the changes if you are only looking for one kind of change. This becomes especially important when making format changes to the source code. If format and functional changes are combined it becomes very difficult to identify useful changes. Imagine if the spacing in a file is changed from using tabs to three spaces every tab in the file will show as having been changed. This becomes critical if some functional changes are also made as a reviewer may simply not see the functional changes.<ref>{{cite book |first=Boisvert |last=Barney |title=Atomic Commits to Version Control |url=http://www.barneyb.com/barneyblog/2006/01/27/atomic-commits-to-version-control/}}</ref><ref>{{cite web |publisher=Conifer Systems |title=The Benefits of Small Commits |url=http://www.conifersystems.com/2008/11/05/the-benefits-of-small-commits/}}</ref>
 
If only atomic commits are made then commits that introduce errors become much simpler to identify. You are not required to look thoughthrough every commit to see if it was the cause of the error, only the commits dealing with that functionality need to be examined. If the error is to be rolled back, atomic commits again make the job much simpler. Instead of having to [[Reversion (software development)|revert]] to the offending revision and remove the changes manually before integrating any later changes; the developer can simply revert any changes in the identified commit. This also reduces the risk of a developer accidentally removing unrelated changes that happened to be in the same commit.
 
Atomic commits also allow bug fixes to be easily reviewed if only a single bug fix is committed at a time. Instead of having to check multiple potentially unrelated files the reviewer must only check files and changes that directly impact the bug being fixed. This also means that bug fixes can be easily packaged for testing as only the changes that fix the bug are in the commit.