Manu

About Commit Messages

I have often enough seen commit messages like this

These messages doesn’t help at all.

What was done there is the cause of action or the activity that was done. Changes were done after the review comments, or updated the model to include a new method. This doesn’t help in sharing context/knowledge. What should be recorded is the change that was made and context around it.

For example: The reviewer suggested to use .map instead of an iterative for loop and pushing the results to an array and returing it explicitly. The commit message could atleast be of the below way:

For example: The reviewer suggested to use .map instead of an iterative for loop and pushing the results to an array and returing it explicitly. The commit message could atleast be of the below way:

  Updated x calculation method to use map instead of for loop

In this manner, we know about the change. This clearly falls in line with what version control is for, we can know what each changes are doing with a git log. The cause or reason of action is irrelavant. One could be making the change after a PR review or pairing session or just self review. It doesn’t matter. What matters is the context around the change that was done.