Changelogs from Commits
Every update needs patch notes: players read them on Steam, itch.io and store pages, and your team reads the internal changelog to know what went into a build. Writing them by hand the night before release means forgetting half the fixes. If commit messages follow a small convention, a script can produce a first draft in a second.
A commit convention
Conventional Commits is the most widely used convention: type(scope): description, where the type says what kind of change it is:
| Type | Meaning | In player-facing notes? |
|---|---|---|
feat |
new feature or content | yes, "New" |
fix |
bug fix | yes, "Fixed" |
balance |
gameplay tuning (a game-specific addition) | yes, "Balance" |
perf |
performance | yes, "Improved" |
docs, chore, ci, refactor, test, build |
internal | no |
! after the type, or BREAKING CHANGE: in the body |
incompatible change (e.g. old saves won't load) | yes, highlighted |
Teams add their own types (balance, art, audio, loc) as long as the list is written down. A commit-message hook or a CI check can enforce the format.
Getting the commits since the last release
Git gives you the raw material. This session (real Git 2.54) creates a small history and lists the subjects since the last tag:
mkdir game && cd game && git init -q
c() { echo "$1" >> notes.txt; git add notes.txt; git commit -q -m "$1"; }
c "feat: first playable"; git tag -a v1.0.0 -m "1.0.0"
c "fix(save): settings were not saved on Linux"
c "feat(levels): add the Frozen Caves level"
c "chore: update editor version"
c "balance(boss): reduce Golem health from 900 to 750"
c "feat(input)!: new control scheme; old rebinds are reset"
git log v1.0.0..HEAD --reverse --format='%h %s'
echo "commits since v1.0.0: $(git rev-list --count v1.0.0..HEAD)"da5da10 fix(save): settings were not saved on Linux
65b5b24 feat(levels): add the Frozen Caves level
64af57e chore: update editor version
3e709a3 balance(boss): reduce Golem health from 900 to 750
cf26d54 feat(input)!: new control scheme; old rebinds are reset
commits since v1.0.0: 5
In a release script, git describe --tags --abbrev=0 finds the previous tag, and git log <tag>..HEAD --format=… produces the input for the generator.
The changelog generator
This generator takes those subject lines (inlined here, since the browser can't run Git) and produces two documents: an internal changelog with every relevant change, and short player-facing patch notes in plain language:
import re
log = """\
a1c09e2 fix(save): settings were not saved on Linux
5b7d3f1 feat(levels): add the Frozen Caves level
c4e2a90 chore: update editor version
9d0f6b3 balance(boss): reduce Golem health from 900 to 750
e7a1c55 feat(input)!: new control scheme; old rebinds are reset
0f3b9d8 docs: explain the build script
2c8e4a1 fix(audio): music no longer stops after alt-tab
71bb0c2 perf(particles): pool explosion effects
"""
PATTERN = re.compile(r"^(?P<sha>[0-9a-f]+) (?P<type>\w+)(?:\((?P<scope>[\w-]+)\))?(?P<breaking>!)?: (?P<desc>.+)quot;)
SECTIONS = [("feat", "New"), ("fix", "Fixed"), ("balance", "Balance"), ("perf", "Improved")]
def generate(version, text):
groups, breaking, skipped = {}, [], 0
for line in text.strip().splitlines():
m = PATTERN.match(line)
if not m or m["type"] not in dict(SECTIONS):
skipped += 1
continue
entry = (m["scope"], m["desc"], m["sha"])
groups.setdefault(m["type"], []).append(entry)
if m["breaking"]:
breaking.append(entry)
out = [f"## {version}", ""]
if breaking:
out.append("**Breaking:** " + "; ".join(d for _, d, _ in breaking))
out.append("")
for key, title in SECTIONS:
if key in groups:
out.append(f"### {title}")
for scope, desc, sha in groups[key]:
out.append(f"- {'**' + scope + ':** ' if scope else ''}{desc} ({sha})")
out.append("")
out.append(f"<!-- {skipped} internal commit(s) omitted -->")
return "\n".join(out)
def patch_notes(version, text):
lines = [f"Version {version} is out!"]
for line in text.strip().splitlines():
m = PATTERN.match(line)
if m and m["type"] in ("feat", "fix", "balance"):
desc = m["desc"][0].upper() + m["desc"][1:]
lines.append(f"* {desc}")
return "\n".join(lines)
print(generate("1.1.0", log))
print()
print(patch_notes("1.1.0", log))## 1.1.0
**Breaking:** new control scheme; old rebinds are reset
### New
- **levels:** add the Frozen Caves level (5b7d3f1)
- **input:** new control scheme; old rebinds are reset (e7a1c55)
### Fixed
- **save:** settings were not saved on Linux (a1c09e2)
- **audio:** music no longer stops after alt-tab (2c8e4a1)
### Balance
- **boss:** reduce Golem health from 900 to 750 (9d0f6b3)
### Improved
- **particles:** pool explosion effects (71bb0c2)
<!-- 2 internal commit(s) omitted -->
Version 1.1.0 is out!
* Settings were not saved on Linux
* Add the Frozen Caves level
* Reduce Golem health from 900 to 750
* New control scheme; old rebinds are reset
* Music no longer stops after alt-tab
The generator is a draft tool. Read its output before publishing: commit messages are written for developers ("pool explosion effects") and patch notes for players ("smoother frame rate in big fights"). The script saves the tedious part; the human writes the last 10%.
Wiring it into a release
- CI or a release script runs
git log <last-tag>..HEAD --format='%h %s', feeds the generator, and prepends the result toCHANGELOG.md(the format at keepachangelog.com is a good template). - A person edits the patch notes and commits them with the version bump.
- The tag is created on that commit; CI builds and uploads it (Version & Build Numbers).
- The same notes go to the store's update post, the devlog and the Discord announcement.
Ready-made tools exist (release-please, git-cliff, semantic-release, conventional-changelog), and they handle edge cases such as merge commits and monorepos. Writing the small version once teaches you what they do.
Test yourself
In Conventional Commits, what does feat(input)!: ... signal?
- A failed build
- A new feature in the input scope that is a breaking change
- An urgent fix
- A chore
Which command lists commit subjects since the tag v1.0.0?
- git log v1.0.0
- git log v1.0.0..HEAD --format='%s'
- git tag -l
- git describe
Why is a generated changelog only a draft for player-facing notes?
- Generators are inaccurate
- Commit messages are written for developers; players need plain-language descriptions
- Stores reject generated text
- It's too short