| summary | Commit rules: commit message format, the type list, atomic commits, changes to the C engine and its generated files, branches and merge commits | ||||
|---|---|---|---|---|---|
| read_when |
|
English · 简体中文
<type>[scope]: <imperative summary>
<optional body: why the change was made, and any trade-offs that are not obvious>
- The summary is at most 72 characters, with no period at the end.
- type:
featfixdocsstylerefactorperftestbuildcichorerevert. - scope is the affected package or area, such as
engine,gen,intl,vm,compare,readme. - For a breaking change, add
!after the type, or writeBREAKING CHANGE:at the end of the body. - Do not use semicolons in commit messages, and do not use dashes as punctuation.
- No signature or co-author lines.
Examples from the history:
fix(engine): make javascript's local time UTC whatever zone the process has
perf(engine): count the interrupt counter down inside the interpreter
feat(gen): refuse a call the stack check does not cover
build!: rename the module to github.com/liustack/quickjs
- 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.
- Mechanical changes such as pure refactors, formatting and renames are committed separately, not mixed with behavior changes.
- A change to the C of
engine/, to the generator underinternal/goasm/genor to the flags ofscripts/gen-engine.shorengine/test/flags.shgoes in the same commit as the files ofinternal/cenginethatmake genandmake gen ARCH=arm64make from it, so thatmake check-genpasses at every commit. Never edit the generated files by hand. - Do not commit build or test output:
*.test,mem.out, the test262 archive and the foldersengine/test/outand.build,go.work. They are in.gitignore. - Do not use summaries like "WIP" or "fix stuff" that do not say what changed.
- Do not develop directly on
main. Rungit switch -c <branch>first. - A branch goes into
mainwith a merge commit (git merge --no-ff), whose message ismerge: <what the branch does>, such asmerge: count interrupts down inline, cache small blocks and keep shapes.git log --first-parent mainthen reads as the list of changes, and releases are tagged on these merge commits (see releasing.md). - Before committing, run the checks in testing.md.