| summary | Commit rules: message format, the type list, atomic commits, generated files, branches and merges, the changelog | |||
|---|---|---|---|---|
| read_when |
|
|||
| audience | developers |
<type>[scope]: <imperative summary>
<optional body: why the change was made, and trade-offs that are not obvious>
- The summary is at most 72 characters, with no period at the end.
- type:
featfixdocsstylerefactorperftestbuildcichorerevert. - scope is the package or area, such as
engine,libc,gen,driver,docs. - For a breaking change, add
!after the type, or writeBREAKING CHANGE:at the end of the body. - No semicolons, and no dashes as punctuation.
- No signature or co-author lines.
- One commit does one thing, and can be verified and reverted on its own.
- A behavior change and its tests go in the same commit.
- Pure refactors, formatting and renames are committed on their own.
- A change to
engine/, to the generator or toscripts/gen-engine.shgoes in the same commit as the generated files it changes, once they are checked in. Never edit generated files by hand. - Do not commit build output:
.build/,*.test,*.out.
- Work on a branch (
git switch -c <branch>), not onmain. - A branch goes into
mainwith a merge commit (git merge --no-ff), whose message ismerge: <what the branch does>.git log --first-parent mainthen reads as the list of changes. - Run the checks before every commit.
- A merge that changes what users get (a fix, a new feature, a new limit, a supported target) adds a line under
Unreleasedin CHANGELOG.md: what changed for the user, not how. Tests, CI, benchmarks and docs get no line. - A change that an issue asked for links the issue and thanks the person who opened it.
- Before a tag,
UnreleasedbecomesvX.Y.Z (date), in its own commit.