Skip to main content
Porffor follows a specific commit message style to keep the git history clean and informative.

Basic Format

Commit messages should follow this pattern:
${file}: ${description}
Where:
  • ${file} - The main file or area changed (without extension or path prefix)
  • ${description} - Brief description of what changed

Examples

Built-in Implementations

builtins/date: impl toJSON
builtins/array: wip toReversed
builtins/tostring_number: impl radix

Bug Fixes

builtins/date: fix ToIntegerOrInfinity returning -0
builtins/string: fix trim not handling edge cases

Compiler Changes

codegen: fix inline wasm for unreachable
opt: improve constant folding
assemble: add support for custom sections

Prefixes by Area

Use these prefixes based on what you’re changing:
PrefixUse ForExample
builtins/arrayArray built-insbuiltins/array: add toSorted
builtins/stringString built-insbuiltins/string: impl trimEnd
builtins/dateDate built-insbuiltins/date: fix getTime
builtins/numberNumber built-insbuiltins/number: add toFixed
builtins/mathMath built-insbuiltins/math: impl hypot
builtins/objectObject built-insbuiltins/object: add freeze
builtins/jsonJSON built-insbuiltins/json: fix stringify
builtins/*Other built-insbuiltins/console: add debug
codegenCode generationcodegen: optimize loops
optOptimizeropt: add dead code elimination
assembleWasm assemblyassemble: fix section ordering
test262Test infrastructuretest262: add error tracking
runtimeRuntime utilitiesruntime: improve repl
2cWasm to C compiler2c: optimize memory ops

Description Guidelines

Keep It Concise

If possible, use short descriptions:
builtins/array: add map
But don’t be afraid to use longer titles when needed:
builtins/string: fix toUpperCase not handling non-ASCII correctly

Use Imperative Mood

Write as if giving a command:
builtins/array: add filter method        ✅
builtins/array: added filter method      ❌
builtins/array: adds filter method       ❌

Common Verbs

  • add / impl - New feature or method
  • fix - Bug fix
  • update - Enhancement to existing feature
  • optimize - Performance improvement
  • refactor - Code restructuring
  • remove - Deletion
  • wip - Work in progress

Multi-File Changes

If your change affects multiple files, use the primary file or area:
builtins/string: impl trim, trimStart, trimEnd
Or use the general area:
builtins: fix multiple type coercion issues

Commit Descriptions (Optional)

You can add detailed descriptions in the commit body:
builtins/array: impl toSorted

Implements Array.prototype.toSorted() which returns a new sorted array
without modifying the original. Uses the same sorting algorithm as sort()
but operates on a copy.

Test262: +47 passes in built-ins/Array/prototype/toSorted/
Bonus points for:
  • Detailed explanations
  • Test262 results
  • Performance notes
  • Jokes in the description

Work in Progress

For incomplete features, use wip:
builtins/array: wip toReversed
This signals that the feature isn’t complete yet.

Git Workflow

One Commit Per Change

Ideally, have one commit per notable change. Use amend and force push to keep history clean:
# Make changes
git add .
git commit -m "builtins/string: impl trim"

# Oops, found an issue
# Fix it, then amend
git add .
git commit --amend --no-edit

# Force push (if you already pushed)
git push --force
Never force push to main/master unless explicitly requested and understood.

Multiple Commits

If you’re working on several independent features, separate commits are fine:
git commit -m "builtins/string: impl trim"
git commit -m "builtins/string: impl trimStart"  
git commit -m "builtins/string: impl trimEnd"

What NOT to Include

Don’t include in your commits:

Generated Files

Don’t manually edit or commit:
  • compiler/builtins_precompiled.js (generated by precompile)
These are automatically generated.

Secrets

Never commit:
  • .env files
  • credentials.json
  • API keys
  • Passwords
If you accidentally commit secrets, ask for help immediately.

Real Examples from Porffor

Here are actual commits from Porffor’s history:
builtins/date: impl toJSON
Implemented a new method.
builtins/date: fix ToIntegerOrInfinity returning -0
Fixed a specific bug.
codegen: fix inline wasm for unreachable
Fixed a compiler issue.
builtins/array: wip toReversed
Work in progress on a feature.
builtins/tostring_number: impl radix
Implemented radix support for number to string conversion.

Before Submitting

Check Your Changes

# See what you changed
git status
git diff

# See recent commits for style examples
git log --oneline -10

Ensure Tests Pass

Run Test262 to verify your changes:
node test262 --threads=8
See Testing for details.

Review Your Commit

# View your commit
git show

# Check commit message
git log -1

Summary

Format: ${file}: ${description} Examples:
builtins/array: add map
builtins/string: fix trim edge cases  
codegen: optimize function calls
Tips:
  • Keep it concise but clear
  • Use imperative mood
  • One commit per feature (use amend)
  • Add detailed descriptions in commit body
  • Don’t commit generated files or secrets

Next Steps

Build docs developers (and LLMs) love