orhun / git-cliff

A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
https://git-cliff.org
Apache License 2.0
8.7k stars 185 forks source link

Regenerating changelog after taging changes the date #796

Open alerque opened 1 month ago

alerque commented 1 month ago

Is there an existing issue for this?

Description of the bug

I've been using git cliff -t vX.Y.Z as part of a build system as a way to lint the release and make sure everything got generated properly. This works fine the day-of, but fails if run later. The generated changelog always has the current date even if the tag and release already exists.

I understand there is a cart-before-the-horse issue at play here, but it seems like if a tag exists, the release date should be derived from the tag rather than the current time. Notably this is only a problem for the current release, it does not affect the backlog of generated releases all the rest of which are untouched.

Steps To Reproduce

Rebuild a changelog while on a tagged release on a day later than the changelog was originally generated.

Expected behavior

Release date to be derived from the tag if extant, current date if not.

Screenshots / Logs

No response

Software information

git-cliff 2.4.0

Additional context

No response

orhun commented 3 days ago

Hey, thanks for reporting!

This should be fixed via #861, can you test it out? 🐻