Atomic Commit - Atomic Commit Convention

Atomic Commit Convention

When using a revision control systems a common convention is to use small commits. These are sometimes referred to as atomic commits as they (ideally) only affect a single aspect of the system. These atomic commits allow for greater understandability, less effort to roll back changes, easier bug identification.

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.

If only atomic commits are made then commits that introduce errors become much simpler to identify. You are not required to look though 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 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 means that a developer will not remove changes that did not cause the error by accident.

Atomic commits also allow bug fixes to be easily reviewed if only a single bug fixes 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.

Read more about this topic:  Atomic Commit

Famous quotes containing the words atomic, commit and/or convention:

    The pace of science forces the pace of technique. Theoretical physics forces atomic energy on us; the successful production of the fission bomb forces upon us the manufacture of the hydrogen bomb. We do not choose our problems, we do not choose our products; we are pushed, we are forced—by what? By a system which has no purpose and goal transcending it, and which makes man its appendix.
    Erich Fromm (1900–1980)

    In progress of time, when my mind was, as it were, strongly impregnated with the Johnsonian æther, I could, with much more facility and exactness, carry in my memory and commit to paper the exuberant variety of his wit and wisdom.
    James Boswell (1740–1795)

    “We’ll encounter opposition, won’t we, if we give women the same education that we give to men,” Socrates says to Galucon. “For then we’d have to let women ... exercise in the company of men. And we know how ridiculous that would seem.” ... Convention and habit are women’s enemies here, and reason their ally.
    Martha Nussbaum (b. 1947)