Introduction

I don't know how everyone defines the version number of the software? Does it honestly start from version 1.0, or directly from 2.0 like Ellison, or from beta version 0.x?

Although at a glance, we would definitely want to use the software with the highest version number, because the higher the version number, the more iterations and the more stable the function.

This is not to discuss the quality of the version, here is how to make the version speak.

Let the version speak

Why let the version speak? What will the version say?

The meaning of letting the version speak is that the version itself represents a certain meaning, and the general situation of this version can be basically understood through the version number.

Why do you need to control the version

So why do you want to control the version? That's because in modern applications, a project needs to rely heavily on third-party projects, and third-party projects will rely on other projects, thus generating a huge set of dependencies.

In the case of such a huge version dependency, we need to roughly know that the existing project can rely on the general version range of the third-party project, so that when the project version is upgraded, it will not cause problems in this project.

So we need a version to make rules.

This is the semantic version we are going to talk about today.

Semantic version specification

In the semantic version, the version number is composed of three parts, and its format is: XYZ (major version number. minor version number. revision number).

If it is just a bug fix and does not affect the API, the revision number will be incremented. If the API maintains downward compatibility for additions and modifications, the minor version number will be incremented; if the revision is not backward compatible, the major version number will be incremented.

Isn't it clear what version to use?

Specifically, X, Y, and Z are non-negative integers, where X is the major version number, Y is the minor version number, and Z is the revision number. And need to follow some of the following principles to ensure the correctness of the semantic version specification. Let’s take a look at the rules:

  1. After a version is released, it is forbidden to modify the revised version. If modification is required, the version number is incremented.
  2. A version with a major version number of 0, such as 0.1.3, means that the software is still in the initial development stage and the software is not stable.
  3. Versions after 1.0.0 are considered stable versions.
  4. If it is an internal bug fix for the API, the value of Z is incremented.
  5. If a new downward compatible function is added, the value of Y is incremented. If an API is marked as obsolete, the value of Y also needs to be incremented. You can also increment the Y value when a large number of new features are included. Whenever the Y value increases, the Z value needs to be reset to zero.
  6. Y will be incremented when adding any incompatible APIs. Whenever the major version number is incremented, the minor version number and revision number must be reset to zero.
  7. In addition to the main version, you can also add an advanced version number after the main version. The advanced version number is a combination of numbers and letters, followed by a connection number after the main version. For example, 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92. The previous version number indicates that this version is not stable and may not meet the expected compatibility requirements.
  8. You can also add the compiled version number after the previous version number or the major version number. The compiled version number is also a combination of numbers and letters, followed by a plus sign after the main version or previous version number. Such as: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.

Summarize

The above is the basic description of the semantic version. If everyone compiles the version according to the semantic specification mentioned above, then our software world will become infinitely better.

This article has been included in http://www.flydean.com/03-semantic-version/

The most popular interpretation, the most profound dry goods, the most concise tutorial, and many tips you don't know are waiting for you to discover!

Welcome to pay attention to my official account: "programs, those things", know the technology, know you better!


flydean
890 声望432 粉丝

欢迎访问我的个人网站:www.flydean.com