Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for not bump major version #677

Open
1 task done
m47730 opened this issue Jun 5, 2024 · 12 comments
Open
1 task done

Add option for not bump major version #677

m47730 opened this issue Jun 5, 2024 · 12 comments
Assignees
Labels
feature/request New feature or request

Comments

@m47730
Copy link

m47730 commented Jun 5, 2024

Is there an existing issue or pull request for this?

  • I have searched the existing issues and pull requests

Feature description

Hi,
first of all: thanks for this tool, i love it!

I'm trying to briefly explain my needs:
in some scenario i have two version of a library (one for a language version and one for another), in this case i simply use master to advance and a branch release-1.x to keep the versioning for the old language and i want to keep 1.x.x semver.

So it could be very helpful to have an option like features_never_bump_major and breaking_never_bump_major or something else to assure that the bump is never for major

Desired solution

add some option to avoid major bumping

Alternatives considered

i could add some enforcing on ci or git hooks to avoid commit description with potential major bump, but is cumbersome and error prone

Additional context

No response

@m47730 m47730 added the feature/request New feature or request label Jun 5, 2024
Copy link

welcome bot commented Jun 5, 2024

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

@orhun
Copy link
Owner

orhun commented Jun 5, 2024

Hello, thanks for reporting this! 🐻

git-cliff uses the next_version crate for bumping the version. It might be better to ask the maintainer of that crate @MarcoIeni regarding if a new config option like that would be applicable or not :)

@orhun orhun changed the title add option for not bump major version Add option for not bump major version Jun 5, 2024
@MarcoIeni
Copy link
Contributor

Hi, I'm truly sorry, but I'm not keen to add this option. It seems like a very unique use case, and I don't want to complicate the codebase to add it. Again, sorry!
I hope you find a workaround.

@orhun orhun closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@MarcoIeni
Copy link
Contributor

Orhun, if you want to implement this feature in git-cliff, I'm happy to help. E.g. if git-cliff has the features_never_bump_major set, and the library next_version returns a major bump, you could instead bump the minor version yourself.

@orhun
Copy link
Owner

orhun commented Jun 7, 2024

I think the best way would be to have this functionality in next_version not to segregate things. But it's fine, I guess we can do it here too.

next_version returns a major bump, you could instead bump the minor version yourself.

How can we check if the returned version is major bump etc?

@orhun orhun reopened this Jun 7, 2024
@mbodmer
Copy link

mbodmer commented Jun 14, 2024

I think it would make the most sense if the default behavior would be according to: https://doc.rust-lang.org/cargo/reference/semver.html

Initial development releases starting with “0.y.z” can treat changes in “y” as a major release, and “z” as a minor release. “0.0.z” releases are always major changes. This is because Cargo uses the convention that only changes in the left-most non-zero component are considered incompatible.

The option breaking_always_bump_major is still ok and can be respected when set, alternatively it's default value could be auto

@MarcoIeni
Copy link
Contributor

MarcoIeni commented Jun 21, 2024

Could we maybe reuse the mechanism of release-plz/release-plz@0a97ba4

Eg we specify feat to as a patch bump. So that it doesn't bump minor. 🤔

For breaking changes there could be something similar 🤔🤔 (I know it's very similar to what was proposed in this issue 😅).

Btw Orhun, I'm on mobile, so I'm not sure how you invoke next_version. But to check if a major has been updated, you could simply compare the two major versions (before and after the bump). The next_version crate exposes some functionalities to do the bump manually.

Have a look at:

mbodmer, the behavior you described is already the default 👍

@braineo
Copy link
Contributor

braineo commented Jul 4, 2024

Could we maybe reuse the mechanism of MarcoIeni/release-plz@0a97ba4

Eg we specify feat to as a patch bump. So that it doesn't bump minor. 🤔

For breaking changes there could be something similar 🤔🤔 (I know it's very similar to what was proposed in this issue 😅).

Btw Orhun, I'm on mobile, so I'm not sure how you invoke next_version. But to check if a major has been updated, you could simply compare the two major versions (before and after the bump). The next_version crate exposes some functionalities to do the bump manually.

Have a look at:

mbodmer, the behavior you described is already the default 👍

do you think adding a flag to specify the bump version type to use increment_xxx api in the next_version can be considered?

i come from standard-version and wonder if there is anything equivalent to --release-as in that

@MarcoIeni
Copy link
Contributor

You can already do this without adding another option. Check out the links I posted above.

@braineo
Copy link
Contributor

braineo commented Jul 4, 2024

Sorry. Do you mean there is already a way to specify bump type in git-cliff? I saw your link to next_version and release-plz. I must be missing something here.

@MarcoIeni
Copy link
Contributor

No, I'm talking about the next_version library. I didn't get your request was for git cliff 👍

@braineo
Copy link
Contributor

braineo commented Jul 5, 2024

No, I'm talking about the next_version library. I didn't get your request was for git cliff 👍

thanks, i made use of the api and made a pr in #744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants