fix: regenerate changelog after tagging in release#54
Merged
Conversation
git-cliff was run on an untagged HEAD before the release commit and tag existed, so it overwrote CHANGELOG.md with a single empty version header and dropped all prior releases. Create the release commit and tag first, then regenerate the changelog from the tagged history, fold it into the release commit via --amend, and move the tag onto the amended commit.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
devloop | 92f9b1e | Commit Preview URL Branch Preview URL |
Jun 09 2026, 08:26 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every release since
0.3.0wipedCHANGELOG.mddown to a single empty version header (e.g. just## [0.4.0]), dropping all prior history. The changelog was never additive.Root cause
scripts/release.shinvoked git-cliff with two flags that, in git-cliff 2.x, each collapse the output to a bare## [Unreleased]/## [X.Y.Z]header with no body and no prior versions:--workdir "$ROOT"(absolute path) — breaks git-cliff's detection that HEAD is on a tag. Isolated via an A/B in an identical repo state:--workdir <abs>→ 1 section; no--workdir(run from cwd) → all 4 sections.--tag <new version>on an untagged HEAD — git-cliff ran before the release commit and tag existed, so it treated the version as brand new and truncated the same way.Both were verified by reproducing the exact release-time git state in throwaway worktrees/clones and inspecting
git-cliff --context(collectedv0.4.0 -> 0 commits, no prior releases).Fix
Reorder and de-flag the generation step:
VERSION, then create the tag, so HEAD is tagged before git-cliff runs.$ROOT(subshellcd) without--workdirand without--tag, so it renders the full history from the tagged commits.CHANGELOG.mdinto the release commit via--amendand move the tag onto the amended commit, keeping one cleanchore: release Xcommit.Dry-run output updated to describe the new ordering.
Verification
bash scripts/devloop_test.shpasses (100% function coverage).release patchruns keep the changelog fully additive (all four versions, 119 lines), and each tag's commit contains the complete changelog.Not retroactively backfilling the wiped
CHANGELOG.md— the next patch release regenerates the full history from scratch, which is the intended behavior.