Skip to content

chore(release): one changelog hook, with the full history - #362

Merged
scarmuega merged 1 commit into
mainfrom
chore/release-changelog-hook
Sep 26, 2026
Merged

scarmuega merged 1 commit into
mainfrom
chore/release-changelog-hook

Conversation

@scarmuega

Copy link
Copy Markdown
Contributor

Summary

The v0.24.0 release left the worktree dirty and wrote an empty changelog section. This PR fixes both for future releases.

  • Stray changelogs. release.toml set a workspace-wide pre-release-hook. cargo-release runs it once per crate, from that crate's directory, so git cliff -o CHANGELOG.md wrote untracked CHANGELOG.md files into bin/tx3c, crates/tx3-cardano and crates/tx3-resolver. The workspace hook is removed. The single hook in crates/tx3-lang writes the root CHANGELOG.md.
  • Empty changelogs. git-cliff 2.10.1, run inside this repo as a git submodule, limits itself to a wrongly resolved "current directory" and drops every commit. That is why the 0.23.0 and 0.24.0 sections were empty. git-cliff 2.14.2 fixes this, in fix(args): resolve --workdir to a repo-relative include path orhun/git-cliff#1627. The hook now passes --include-path '**/*', so older versions produce the full history too.
  • Tag format. The hook's --tag now uses the v prefix, matching tag-name = "v{{version}}".

Verification

I ran the new hook exactly as cargo-release would, from crates/tx3-lang with WORKSPACE_ROOT set:

  • It regenerated the full root changelog, 224 entries, identical to the corrected v0.24.0 CHANGELOG.md.
  • It wrote no files outside the root CHANGELOG.md.
  • cargo release config shows no workspace hook, and cargo metadata parses.

🤖 Generated with Claude Code

`cargo release` left the worktree dirty and wrote empty changelogs:

- release.toml set a workspace-wide pre-release-hook. cargo-release runs
  it once per crate from that crate's directory, so `git cliff -o
  CHANGELOG.md` wrote a stray CHANGELOG.md into bin/tx3c,
  crates/tx3-cardano, and crates/tx3-resolver. The release commit only
  stages tracked files, so they were left behind untracked.
- git-cliff 2.10.1 run inside this git submodule limits itself to a
  wrongly resolved "current directory" path and drops every commit, so
  the 0.23.0 and 0.24.0 sections came out empty. git-cliff 2.14.2 fixes
  this (orhun/git-cliff#1627).

Keep the single hook in crates/tx3-lang, which writes the root
CHANGELOG.md, and pass `--include-path '**/*'` so older git-cliff
versions produce the full history too. The tag argument now carries the
`v` prefix, matching `tag-name`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@scarmuega
scarmuega merged commit 9a7b6bb into main Sep 26, 2026
14 checks passed
@scarmuega
scarmuega deleted the chore/release-changelog-hook branch September 26, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant