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

--unreleased does not behave as expected with tags on side branches

Open chrissi-p opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description of the bug

If I have a project where tags are also created on side branches and not only on the master branch, git cliff seems to get confused, if the --unreleased flag is used. I would expect to see only commit messages parsed that do not belong to a commit, but this does not seem to be the case. If on a side branch a new tag was created to fix a older version also already tagged commits form the master branch start to appear in the change log. It seams the last commit in time on any branch is used to determine the unreleased commits.

Steps To Reproduce

  1. Create tag 2.0.0 on branch master
  2. Create tag 1.0.1 on branch e.g. release/1
  3. Create tag 2.1.0 on head of master
  4. Add new commit on master
  5. Create a change log on master with git cliff -u

Expected behavior

It is expected that only the newly created commit on master appears in the change log, created by git cliff.

But what I see instead, that also the commits of the tag 2.0.0 are included.

Screenshots / Logs

image001

Software information

  • Operating system: WSL - Ubuntu 22.04
  • Rust version:
  • Project version: 2.4.0

Additional context

As soon as a new tag is created on the master branch, the behavior is again as expected.

chrissi-p avatar Jul 08 '24 15:07 chrissi-p

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

welcome[bot] avatar Jul 08 '24 15:07 welcome[bot]

also observed this one. but if the changelog is generated from scratch without any flags the result is correct.

braineo avatar Aug 22 '24 08:08 braineo

hi @chrissi-p can you check if my pr fixes the problem?

braineo avatar Aug 22 '24 12:08 braineo

Now you can use --use-branch-tags for this 🚀

orhun avatar Sep 09 '24 18:09 orhun