A Commit Message Experiment

I’ve been running an experiment lately that has created some interesting results in my day to day workflow. It goes as follows:

Write the commit message before making any changes.

This small idea has had the following beneficial results:

  • I am forced to stop and really consider the root of an issue earlier in my workflow. A throwaway spike may help with this but it must be thrown out before the real change goes in.
  • This level of planning has led to more granular individual commits.
  • I have been individually committing refactorings that would normally be lumped into a larger changeset.
  • The smaller commits appear to be more intention revealing.
  • I have an easier time staying on track when I find unrelated changes in the course of another change.

Overall, I like the effects this simple change has produced. You could probably argue that I am really just advocating smaller commits, and you would probably be correct. However, this experiment has helped push me to that goal with a minimal amount of effort.


comments powered by Disqus