Skip to content

fix: the changelog's commit hashes are always seven characters, so --check agrees on every machine - #160

Open
lnorton89 wants to merge 1 commit into
masterfrom
fix/changelog-short-hash
Open

lnorton89 wants to merge 1 commit into
masterfrom
fix/changelog-short-hash

Conversation

@lnorton89

Copy link
Copy Markdown
Owner

cargo xtask changelog --check failed on LIGHTNING's checkouts while passing on CI.

Cause: the changelog took short hashes from git's %h, and git lengthens an abbreviation until it is unique among the objects that clone holds. The same commit therefore got 7 characters on one machine and 8 on another. 0.5.1 already has one 8-character entry, f463b3e2. On a clone with more objects, every released entry differed.

Fix: short_hash takes the first seven characters of the full hash. Links still use the full hash. CHANGELOG.md is rebuilt under the new rule, which changes that one released entry and fills Unreleased; --check ignores Unreleased.

Checked: cargo xtask ci fmt generated conventions passes on LIGHTNING, along with xtask's clippy and tests. New test: the_short_hash_is_seven_characters_whatever_git_would_choose.

…check agrees on every machine

git's %h lengthens an abbreviation until it is unique among the objects a clone holds, so the same commit got 7 characters on one machine and 8 on another (f463b3e in 0.5.1), and --check failed wherever the clone differed from the one that wrote the file. The changelog now takes the first seven characters of the full hash; links still use the full hash. CHANGELOG.md is rebuilt under that rule.
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @lnorton89's task in 11s —— View job


Review of PR #160

No issues found. short_hash takes the first seven characters of the full hash, so the changelog no longer depends on git's %h abbreviation length. .get(..7) is safe on short input and on non-char-boundary slicing, and it doesn't use unwrap or expect. Links still use the full hash. The new test covers both the normal case and the shorter-than-seven case. I didn't build or run the tests in this review. CHANGELOG.md is regenerated output and not a hand edit. This is a small fix, so I didn't expect a ROADMAP or DECISIONS entry.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant