Commit messages should be self explanatory with enough detail for developers, maintainers, testers and every other member of the development team to understand what exactly has changed with each commit.
Summary is the must have and it has two parts in it. First part is the name of the module and the second part is the summary of the change.
Description is made out of several parts, it can be considered as a template of explaining, giving enough detail on the changes about:
While writing the commit message consider using the “This commit will …" pattern.
Other than summary, all the parts are optional yet, it is highly encouraged to use them. Template and example can be found below:
Module Name Abbreviation(if needed): Summarize the change in less than 50 characters What is changed (if needed): - Explain new algorithm. - Explain new dependencies. Because (if needed): - Explain the reasons you made this change - Make a new bullet for each reason - Each line should be under 72 characters Remarks (if needed): Include any additional notes, relevant links, or co-authors.(if needed)
search: Refactor algorithm What is changed: - The new algorithm's worst case O(n log(n)). - "HyperSupperDupper Sort" library is not used anymore. Because: - Old algorithm was not optimized. - System tend to crash with big data. Remarks: Corner cases were not covered. (see # 11231) These changes should resolve issue # 1337. This commit removed the getFirst(), so please stop using it! Co-authored-by: cool.guy <email@example.com>
Another cool git commit can be found here.