Commit logs are mostly used when trying to get an overview about changes and when searching for a cause of a problem.
Therefore, comment about the reasons for the change and summarize the change. It is not important to describe the code changes accurately since there will be a possibility to see a diff of the commit.
Summarize the commit in 50 characters. If there's more you wish to comment insert an empty line and then add more detailed description. A short summary is important because it makes it easier to browse logs of commits.
Issue trackers often integrate with version control systems via commit comments. They often require an id of an issue in the commit comment for this integration to work. Even if there isn't this kind of integration, adding an issue tracker id in the commit comment helps to make things more traceable.
In commit comments, present tense is often the favored form.
Example
"Add check for configuration file not existing
The user could remove the configuration file and the program would then
crash during startup. The crash message included sensitive information
and was a security vulnerability."
Therefore, comment about the reasons for the change and summarize the change. It is not important to describe the code changes accurately since there will be a possibility to see a diff of the commit.
Summarize the commit in 50 characters. If there's more you wish to comment insert an empty line and then add more detailed description. A short summary is important because it makes it easier to browse logs of commits.
Issue trackers often integrate with version control systems via commit comments. They often require an id of an issue in the commit comment for this integration to work. Even if there isn't this kind of integration, adding an issue tracker id in the commit comment helps to make things more traceable.
In commit comments, present tense is often the favored form.
Example
"Add check for configuration file not existing
The user could remove the configuration file and the program would then
crash during startup. The crash message included sensitive information
and was a security vulnerability."
More information