Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How/When should I update the version number?

So for more context I use this version numbering system

Version order: MAJOR.MINOR.PATCH

  • MAJOR: The major segment indicates breakage in the API
  • MINOR: The minor segment indicates "externally visible" changes
  • PATCH: The patch segment indicates bug fixes

I have a project on github. so here are my questions.

When do I update my version number?

  • Do I update it when I upload a new update
  • Do I update it after I finish adding/changing some code

How do I increment each change?

  • Do I increment each change then upload that version number
  • Do I say increment only 1 when I upload a new update even though I made several changes. Lets say I made 10 Patch's when I upload do I only Increment by 1 (basically saying there was atleast 1 change) or all 10. So if I were at 1.0.0 and made 10 changes do I put 1.0.1 or 1.0.10 by the final release of the update

Do I reset the version numbers?

  • For example do I reset Patch to 0 after I increment Minor/Major
  • Do I just never reset the version numbers
like image 260
SleepyCatGuy Avatar asked Sep 15 '19 04:09

SleepyCatGuy


People also ask

When should I update my version numbers?

There are simple rules that indicate when you must increment each of these versions: MAJOR is incremented when you make breaking API changes. MINOR is incremented when you add new functionality without breaking the existing API or functionality. PATCH is incremented when you make backwards-compatible bug fixes.

What is the point of version numbers?

Software version numbers indicate changes in a software product. As developers update and improve products, there are often several versions of the product available for end users. At the very least, developers will always create two versions of their software.


1 Answers

When do I update my version number?

It's really up to you to decide when it's appropriate to release a version, but you should be consistent about it. If you have a roadmap for your project, consider grouping multiple related features into one milestone, and bump your minor version upon completion of those features. It's also valid to just bump the minor version with each new feature.

The most important rule is that you do not introduce a breaking change to the public API without bumping the major version. The second most important rule is that you do not introduce any changes without increasing some version number. See the FAQ at https://semver.org/

If you're just fixing a bug or making a minor adjustment, bump the patch version.

How do I increment each change?

This depends on your workflow, and how you decide to differentiate versions. Generally, it makes sense to just increment by one each time, but you could go through multiple private builds before releasing a public build. It's up to you.

Note that if you're building a library or project hosted on something like npm or crates.io, you're required to change the version with each update. Understand the semver-related tools available to you for whatever language you're working in.

Note that semantic versioning does support various labels to identify testing/beta/alpha versions of your project, see rules 9 and 10.

Do I reset the version numbers?

Yes, you should reset the patch number when you bump the minor version, and you should reset the patch and minor number when you bump the major version. Otherwise you'll eventually end up with massive version numbers as your project progresses. See semver rule 11 for information on how precedence is assigned to version numbers.

like image 91
avandesa Avatar answered Oct 17 '22 06:10

avandesa