You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI argument --prepend is supposed to result in git-cliff injecting the changelog for recent releases into an existing changelog.
Remove the old header.
Prepend the new releases' bodies.
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
Set changelog.header to a template such that the output after rendering changes between releases.
Create a new release.
Run git-cliff with the --prepend flag.
Expected behavior
git-cliff should properly detect and replace the old header.
@orhun suggested to simply render the header template prior to running the old logic. However, this is likely insufficient. In cases where the header templating feature is used, the header is likely to change between releases. Thus rendering it will not help in detecting the old header.
If we want --prepend to work reliably, I propose to inject markers using html comments into the markdown instead:
# Changelog
This is the changelog header.
<!-- END OF HEADER -->## Release 2- Lorem Ipsum
## Release 1- Lorem Ipsum
<!-- END OF BODY -->## Footer
This is the changelog footer.
Is there an existing issue for this?
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.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
changelog.header
to a template such that the output after rendering changes between releases.--prepend
flag.Expected behavior
git-cliff should properly detect and replace the old header.
Screenshots / Logs
No response
Software information
changelog.header
a template #698Additional context
No response
The text was updated successfully, but these errors were encountered: