Linus Arver <linusa@xxxxxxxxxx> writes: > The hard part is not so much the rearranging of > code but rather thinking up of good commit messages to explain the > intent of each smaller step. Good. Coming up with a good explanation of what you did forces you to think it thorough again. People often discover bugs in the code they just wrote, or different and better ways to solve the problem, while explaining the change to their colleagues, and I found it has very similar effect to try to write a good explanation in the commit log. Time to write such a good explanation is time worth investing in. Incidentally, this is why we value clearly written proposed log message while reviewing. A commit that is a product of "I tried this, which did not work, and then tried something else, which did not work either, and after some more random tries, this seems to work" would not have a clear thinking behind it, but if such iterations of random tries happened to hit the best solution, thinking backwards from the result to the original problem and explaining how the solution works would result in a good description. Thanks.