git-cliff icon indicating copy to clipboard operation
git-cliff copied to clipboard

Regenerating changelog after taging changes the date

Open alerque opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

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

alerque avatar Aug 13 '24 12:08 alerque

Hey, thanks for reporting!

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

orhun avatar Sep 15 '24 20:09 orhun