commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

[feature] support finding latest relase version in bump version commit message

Open Lee-W opened this issue 5 years ago • 5 comments

Goal Make automatic version bumping possible through version specified in version_files

Description In commitizen/commands/bump.py#L36, we only use git tag to find whether the tag specified in version_file exists. If one project use version_files without git tag, "commitizen" will not be able to know whether it should bump without asking the user, which makes auto version bumping through CI difficult in this case.

Lee-W avatar Jan 29 '20 04:01 Lee-W

Makes sense, it would completly ditch the git dependency. Seems nice.

At the moment my only proposal would be to add a --no-git to cz bump, any other ideas?

On the other hand: Do we want to add this extra complexity? I haven't had the need, I wonder if you or anyone else had it.

woile avatar Jun 26 '20 13:06 woile

I think --file-only alone should work. But I do not have a clear idea of how this should be implemented. I used to need it, but I solve it in another way. It might be needed when you somehow don't have the permission to load the full git history.

Lee-W avatar Jun 26 '20 14:06 Lee-W

Maybe we need to document cz bump --files-only better, which is there already, or fix it to fit this use case. But it needs to be more clear

woile avatar Jun 27 '20 08:06 woile

The same problem also occurs in cz init When I init cz for my existing project, it detect version from git describe --abbrev=0 --tags. However, this is not the version I wanted. Therefore, one of the solutions is to allow me to enter the latest version number during init.

voidful avatar Sep 01 '20 14:09 voidful

Agreed, that'd be helpful in the init

woile avatar Sep 01 '20 20:09 woile

The cz init does allow you to choose the tag from a list if the found one is not correct

woile avatar Apr 28 '23 08:04 woile