orhun/git-cliff

`--prepend` cannot reliably identify the previous header

開放

#712 建立於 2024年6月17日

 (3 則留言) (0 個反應) (0 位負責人)Rust (308 個分叉)auto 404
bughelp wanted

倉庫指標

星標
 (12,040 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

The CLI argument --prepend is supposed to result in git-cliff injecting the changelog for recent releases into an existing changelog.

  1. Remove the old header.
  2. Prepend the new releases' bodies.
  3. Prepend the new header.

Step 1 relied on the header being static between runs of git-cliff. It performed a simple string comparison between the existing CHANGELOG.md and the current value in the changelog.header variable. Since #697, changelog.header contains a template. Thus its value might change between runs and thus prevent detecting the old header.

Steps To Reproduce

  1. Set changelog.header to a template such that the output after rendering changes between releases.
  2. Create a new release.
  3. Run git-cliff with the --prepend flag.

Expected behavior

git-cliff should properly detect and replace the old header.

Screenshots / Logs

No response

Software information

  • After PR #698

Additional context

No response

貢獻者指南