COMMIT_MESSAGES.md
Clover maintainers require high-quality commit messages. Substandard messages noticed during review are grounds for rejection.
Writing low-quality commit messages destroys the utility of git blame.
When the history fails to provide context, developers stop consulting
it. This creates a cycle of neglect: contributors stop writing detailed
messages because they assume the history is unread and unvalued.
This is critical for us because Clover uses commit messages, rather than comments, to record the thinking behind code. In this regard, we follow the tradition of the Linux kernel. Comments remain valuable, but they should be concise and timeless, relying on commit messages to handle historical context.
Therefore, you must have easy access to git blame in your editor or be
familiar with tools that trace the source of lines. If you do not have a
workflow that makes reading blame easy, you will miss important
context.
Here is an example of a commit message for adding this document, with annotations:
Document the commit message rules for Clover | Subject: ~50 chars, imperative mood
The motivation and guidelines for commit messages have never been | Body: Hard-wrapped at 72 chars
written for this project before, leading to confusion. We now have |
enough contributors that a formal treatment is necessary. |
The blog post "How to Write a Git Commit Message" by Chris Beams accurately describes the standards used by projects that follow the Linux example, including ours.
Our specific rules are condensed below:
(feat) or (chore) markers. We do not
use these to generate release notes, so they waste space.postgres:) if it helps keep the
subject short. However, avoid this unless necessary for brevity.
Unlike Linux, we lack the naming conventions required to make
git log --grep filtering on the prefix effective.Compared to Linux or Postgres, we include less metadata, but we follow similar rules otherwise.
Examples from Linux:
Examples from Postgres: