commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Question: unreleased commits ony in last version

Open mastrolube opened this issue 4 years ago • 3 comments

Hello! Sorry for opening an issue, looks like there isn't a "discussion" tab here... I've a problem and probably is due to my lack of knowledge. I'm maintaining a project (which is at v2.10.4) and also working on a v3.0.0 in the meantime. As you can imagine some of my commits in the v3 branch have been made before the release of the latest patches and minors (>2.9.x). For example, I made a commit for v3 (in local) and also pushed the v2.10.2 (remote). All my commits follow the conventional commits:

fix: bla bla feat: bla bla

The problem is when I generate my changelog for version v3 (for beta testing purposes) I get some of my commits in the older versions.

For example, in the Changelog.MD lot of commits gets added to version 2.10.2 which has been just released and doesn't contain them.

2.10.2 (2021-11-06) Fix

  • OK
  • OK
  • SHOULD NOT BE THERE (v3 related)
  • SHOULD NOT BE THERE (v3 related)
  • OK
  • SHOULD NOT BE THERE (v3 related)

Did I do something wrong when I made commits? Can something be done to have all not released commits in my last beta version instead of having them split in all older versions?

Thank you for your help!

mastrolube avatar Nov 10 '21 09:11 mastrolube

We are sorting by --author-date-order the commits. Could you run this command with the different ordering algorithms and see if any of them outputs in a correct way?

git -c log.showSignature=False log  --pretty="%H%n%s%n%an%n%ae%n%b%n----------commit-delimiter----------"  <SORTING_ARG>

Where SORTING_ARG can be:

  • --date-order
  • --topo-order

Seems like a bit of a stretch for commitizen limits. Not sure if it can support this workflow (maintaining 2 versions at the same time, v2.x and v3.x). It's intended for a more straightforward workflow. v3.x is released, then no more updates on the v2.x.

I wonder if we could find a good strategy to filter the commits already used 🤔 @Lee-W any ideas?

What you can do for now, is manually remove those commits from the CHANGELOG.md. If you are using cz bump --changelog or cz changelog --incremental, commitizen won't touch the existing versions in the changelog.

woile avatar Nov 10 '21 10:11 woile

Thank you very much for the super fast reply! I go the same result from both sorting methods (I checked the 2.10.2 which contains the most unwanted commits and they are all there).

For now, I'll follow your suggestion at the end of your text! Thank you! 👍

mastrolube avatar Nov 10 '21 11:11 mastrolube

I think this is a limitation of commitizen as of now. Don't have a good idea yet 😢

Lee-W avatar Nov 12 '21 00:11 Lee-W