Changelog Forge
Generate a Keep a Changelog entry from git history. The script guarantees completeness (every commit since the last tag is categorized); you guarantee readability (human prose, not commit spam).
Workflow
- Generate the mechanical draft and show it:
python scripts/generate_changelog.py --stdoutIt defaults to commits since the lastv*.*.*tag. Use--since <ref>to override, and--version vX.Y.Zwhen the user named the version. The script prints the rendered markdown block to stdout; status messages go to stderr. - Rewrite every bullet for humans:
- Merge duplicate/near-duplicate entries into one.
- Drop noise:
chore, release bumps, CI-only churn — unless the user asked to include them. - Describe user-facing impact, not mechanics ("fix: typo in header" → omit or fold into a related entry).
- Keep
Breakingentries first and explicit about migration.
- Render the final entry into the exact structure of assets/changelog_template.md — same section order, same headings. Omit empty sections.
- Verify no placeholder survived:
grep -n "{{" CHANGELOG.mdmust return nothing. - Write (or prepend) the entry with the script's
--writemode, or by editing CHANGELOG.md directly if the user prefers:python scripts/generate_changelog.py --version v1.4.0 --write CHANGELOG.md - Show the final entry to the user. Never push, tag, or bump versions unless explicitly asked.
Script reference
--since <ref>— commits after<ref>(default: last semver tag).--version <v>— version header (default:Unreleased).--date YYYY-MM-DD— entry date (default: HEAD commit date, so drafts are reproducible).--write <file>— prepend the entry to an existing changelog, creating one with the Keep a Changelog preamble if missing. Requires an explicit--version. Refuses duplicate versions (exit 4).- Exit codes:
0ok ·2bad arguments ·3git error or no commits found ·4version already present.