Skip to content

Instantly share code, notes, and snippets.

@AbdealiLoKo
Last active May 18, 2022 07:54
Show Gist options
  • Save AbdealiLoKo/a32cb3c3a73e0174a3307d7f93452cec to your computer and use it in GitHub Desktop.
Save AbdealiLoKo/a32cb3c3a73e0174a3307d7f93452cec to your computer and use it in GitHub Desktop.
Better commit messages (message creators and linters)

Better commit messages

The 3 common ways for developers to document information about their work is:

  1. Comments
    • When is this written: When the developer wants something to be clearly and immediately visible to all other developers
    • When is this found: As soon as other developers are reading code, they will find these comments
  2. Commit messages
    • When is this written: When the developer wants to explain the work involved in them making a change. Why a change was made, explanation of the
    • When is this found: When other developers dig a big deeper on why or when a change was made - they will find these commit messages
  3. Tech Documentation
    • When is this written: When the developer wants to explain a complex piece of work or an architectural understanding, they use other documentation tools like confluence etc to explain them
    • When is this found: When a developer is explicitly looking for some information, they may find this information. Because this is separate from the standard tools developers use, it is not as easy to find - in many cases teams use markdown files in the git repo to avoid using a completely separate tool.

Hence, having good commit messages is a very important thing. And adding consistent commit messages (similar to consistent code styles) can be very helpful. There are multiple guides on how to write good commit messages:

But every developer still writes it in a fairly different way, which is why some standard formats have also been created. Like:

Along with these, there are also tools to help beginners to write the commit messages in this standard format. Mainly:

  • Tools that help in preparing the commit message
  • Tools that help validating commit messages (linters)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment