Skip to content

Write changelog atomically in --prepend - #1652

Merged
orhun merged 6 commits into
orhun:mainfrom
intertermux-code:fix/1650-atomic-prepend
Oct 31, 2026
Merged

orhun merged 6 commits into
orhun:mainfrom
intertermux-code:fix/1650-atomic-prepend

Conversation

@intertermux-code

Copy link
Copy Markdown
Contributor

--prepend destroyed the changelog when the write failed partway: it truncated/rewrote the file in place, so a failure left a corrupt file.

Fix: std-only atomic write (write temp + fsync + rename, perm-preserving, dir-sync'd) in lib.rs (+211/-2). A failed prepend now leaves the original changelog untouched.

Fixes #1650.

@codecov-commenter

codecov-commenter commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.64%. Comparing base (82ba45e) to head (e6566a8).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
git-cliff/src/lib.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1652      +/-   ##
==========================================
+ Coverage   53.36%   53.64%   +0.28%     
==========================================
  Files          28       29       +1     
  Lines        2639     2657      +18     
==========================================
+ Hits         1408     1425      +17     
- Misses       1231     1232       +1     
Flag Coverage Δ
unit-tests 53.64% <85.00%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@orhun orhun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@orhun
orhun merged commit bda2156 into orhun:main Oct 31, 2026
112 of 116 checks passed
@welcome

welcome Bot commented Oct 31, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! ⛰️

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.

--prepend leaves the changelog empty when its write fails or the process is killed before the write

3 participants