fix: release docs and version-guard cargo pkgid format - #12
Conversation
cargo pkgid now outputs path+file://...#version instead of name@version. Update sed pattern to match either delimiter.
Greptile SummaryThis PR makes two targeted fixes to the release tooling: it patches the
Confidence Score: 5/5Safe to merge — all three changes are precise, low-risk fixes with no functional regressions. The sed character class No files require special attention.
|
| Filename | Overview |
|---|---|
| .config/lefthook.json | Updated version-guard sed regex from s/.*@// to s/.*[#@]// to handle both legacy name@version and new path+file://...#version cargo pkgid formats. |
| RELEASING.md | Added missing git add -f CHANGELOG.md step to document that CHANGELOG.md must be force-added before the release commit since it is gitignored on main. |
| justfile | Updated changelog recipe to extract version from cargo pkgid (using same [#@] fix) and pass it as --tag "v${version}" to git-cliff, ensuring the generated changelog is correctly tagged. |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Git as Git / Lefthook
participant Cargo as cargo pkgid
participant Cliff as git-cliff
Dev->>Git: git checkout -b release/vx.y.z
Dev->>Dev: Edit Cargo.toml version = x.y.z
Dev->>Cargo: just changelog → cargo pkgid
Cargo-->>Dev: path+file://...#x.y.z (new) or name@x.y.z (old)
Dev->>Dev: sed 's/.*[#@]//' → x.y.z
Dev->>Cliff: git-cliff --tag vx.y.z --output CHANGELOG.md
Cliff-->>Dev: CHANGELOG.md generated
Dev->>Git: git add -f CHANGELOG.md
Dev->>Git: git commit -am "chore: release vx.y.z"
Git->>Git: pre-commit: version-guard
Git->>Cargo: cargo pkgid
Cargo-->>Git: path+file://...#x.y.z
Git->>Git: sed 's/.*[#@]//' → x.y.z ≠ 0.0.0 on release/* → OK
Git->>Git: pre-commit: changelog-guard → CHANGELOG.md staged → OK
Dev->>Git: git tag vx.y.z && git push origin vx.y.z
Reviews (2): Last reviewed commit: "fix(changelog): pass version tag to git-..." | Re-trigger Greptile
…ersioned Without --tag, git-cliff generates '## [Unreleased]' which cargo-dist cannot match to the release version.
Summary
git add -f CHANGELOG.mdis required during the release process (it's gitignored onmain)version-guardto handle the updatedcargo pkgidoutput format (path+file://...#versioninstead ofname@version)Test plan