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
Determine bump type between two different versions #262
Comments
Thanks @tlaferriere for your idea! Haven't thought of that, that's an interesting use case. 👍 I marked it for release 3 of semver as I think, this is a completely new functionality. Would prefer to implement this in a major release. Not sure if I completely understood the details, therefor some questions:
|
Because IMO the biggest use of the "diff" would in determining the relevance of a potential bump, I believe that only returning the first part raised would be enough for most uses. It would keep the complexity at a minimum, which is important for its maintainability.
It could be a
Numerically, I'm leaning towards the
In my use case it would be simply the part, in order to know whether or not to apply the bump that I could apply. Thanks to
Because of the unidirectionality of the bump functions, I think we can ignore the order in which the versions are passed in the function, just to KISS. |
@tomschr I think we should disuss the location of this function. |
@tlaferriere |
Use Case
When using a staging branch, you can stack changes on the staging branch by bumping the prerelease number for every change pushed.
Determining whether to use a major, minor or patch bump on each push requires you check the whether the current prerelease version has had the appropriate bump with respect to the currently released version on master.
For example, pushing a minor change to staging when staging is at
1.0.1-rc.1
and master is at1.0.1
, the appropriate bump here would bebump_minor()
since the staging version is not more recent than the master version.Subsequently (when staging is at
1.1.0-rc.1
and master still at1.0.1
), a minor change or a patch change would not bump minor or patch, but instead bump the prerelease.On the other hand, a major change would require a
bump_major()
.Hopefully the example illustrates where you would need to find the bump type needed to go from one version to another.
Situation
At the moment there is no simple explicit (or implicit) way to determine the diff bump between versions.
One must compare each part of the version to determine which is the bumped part.
This is trivial code that is prone to errors since it must be rewritten by anyone who wishes to achieve this task.
Proposition
Write a function maybe called
diff
that takes twoVersionInfo
objects and returns the differential bump (type: tbd).The text was updated successfully, but these errors were encountered: