Is the PATCH needed? #90

Closed
opened 2026-02-17 11:11:12 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @bessarabov on GitHub (Jul 18, 2013).

I like SemVer much, but I have heard a question that I was not able to answer.

The question is "Is the PATCH needed?"

I understand that the main idea of SemVer is to make things simple and to try to avoid "dependency hell."

Adding PATCH (x.y.Z) does not solve any of this 2 goals. But instead it adds a bit of difficulties. If there was no PATCH in the version you can use pure numeric comparison to compare 2 versions in the format x.y.

The number x.y.z looks very pretty, but what are the real purposes why we need PATCH?

PS this question was born because of the discussion http://questhub.io/realm/perl/quest/51d303b4ecc7889b40000025

Originally created by @bessarabov on GitHub (Jul 18, 2013). I like SemVer much, but I have heard a question that I was not able to answer. The question is "Is the PATCH needed?" I understand that the main idea of SemVer is to make things simple and to try to avoid "dependency hell." Adding PATCH (`x.y.Z`) does not solve any of this 2 goals. But instead it adds a bit of difficulties. If there was no PATCH in the version you can use pure numeric comparison to compare 2 versions in the format `x.y`. The number `x.y.z` looks very pretty, but what are the real purposes why we need PATCH? PS this question was born because of the discussion http://questhub.io/realm/perl/quest/51d303b4ecc7889b40000025
Author
Owner

@haacked commented on GitHub (Jul 18, 2013):

It's right there in the SemVer spec:

PATCH version when you make backwards-compatible bug fixes.

I think there's a real need to identify a new version that is backwards compatible in such a way. It communicates something that having only Major and Minor could not communicate. That's the real benefit of SemVer. It can't prevent "dependency hell" but it can mitigate it by providing a unified way to communicate how different versions have changed.

Also, SemVer is born from distilling practices that were already in existence long before SemVer was around. The idea of a PATCH version was not created by SemVer. It's a long established practice that many communities have found useful.

@haacked commented on GitHub (Jul 18, 2013): It's right there in the SemVer spec: > PATCH version when you make backwards-compatible bug fixes. I think there's a real need to identify a new version that is backwards compatible in such a way. It communicates something that having only Major and Minor could not communicate. That's the real benefit of SemVer. It can't prevent "dependency hell" but it can mitigate it by providing a unified way to communicate how different versions have changed. Also, SemVer is born from distilling practices that were already in existence long before SemVer was around. The idea of a PATCH version was not created by SemVer. It's a long established practice that many communities have found useful.
Author
Owner

@EddieGarmon commented on GitHub (Jul 18, 2013):

Also, not explicitly stated, but x.y is the specific version of an API, and z is the number of bug-fix releases of that API.

@EddieGarmon commented on GitHub (Jul 18, 2013): Also, not explicitly stated, but `x.y` is the specific version of an API, and `z` is the number of bug-fix releases of that API.
Author
Owner

@bessarabov commented on GitHub (Jul 18, 2013):

@Haacked I don't get it. Changing a PATCH version creates the release that is backwards compatible. Changing MINOR version also creates the release that is backwards compatible. What is the difference for the release user?

The argument "It exists for a long time and because of it is is correct" is a bad argument. =)

@bessarabov commented on GitHub (Jul 18, 2013): @Haacked I don't get it. Changing a PATCH version creates the release that is backwards compatible. Changing MINOR version also creates the release that is backwards compatible. What is the difference for the release user? The argument "It exists for a long time and because of it is is correct" is a bad argument. =)
Author
Owner

@bessarabov commented on GitHub (Jul 18, 2013):

@EddieGarmon why do I need to bother for the y in x.y version? There is a state in semver:

Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API.

If I'm a user of some library that users semver, then I worry only about changing MAJOR version number, because it breaks API. Am I right that it does not matter for the end user what change it was — bugfix or some backwards compatible functionality is introduced?

@bessarabov commented on GitHub (Jul 18, 2013): @EddieGarmon why do I need to bother for the `y` in `x.y` version? There is a state in semver: > Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. If I'm a user of some library that users semver, then I worry only about changing MAJOR version number, because it breaks API. Am I right that it does not matter for the end user what change it was — bugfix or some backwards compatible functionality is introduced?
Author
Owner

@EddieGarmon commented on GitHub (Jul 18, 2013):

backwards compatible functionality is introduced to the public API. usually means you added additional types or methods, such that consumers of 1.5 can use 1.6 without taking advantage of the new features and know that they should not break. Ideally this can be done without a recompile for a code based Public API.

In the notion of a specification, such as SemVer, adding a BNF grammer to the spec (see #116) would be new backwards compatible functionality moving the spec to 2.1.0.

@EddieGarmon commented on GitHub (Jul 18, 2013): `backwards compatible functionality is introduced to the public API.` usually means you added additional types or methods, such that consumers of 1.5 can use 1.6 without taking advantage of the new features and know that they should not break. Ideally this can be done without a recompile for a code based Public API. In the notion of a specification, such as SemVer, adding a BNF grammer to the spec (see #116) would be new backwards compatible functionality moving the spec to 2.1.0.
Author
Owner

@bessarabov commented on GitHub (Jul 18, 2013):

@EddieGarmon I completely agree with you =) But I haven't understood from your answer why we need to separate PATCH from MINOR.

@bessarabov commented on GitHub (Jul 18, 2013): @EddieGarmon I completely agree with you =) But I haven't understood from your answer why we need to separate PATCH from MINOR.
Author
Owner

@EddieGarmon commented on GitHub (Jul 18, 2013):

A patch does not add any new api, where a minor does.

@EddieGarmon commented on GitHub (Jul 18, 2013): A patch does not add any new api, where a minor does.
Author
Owner

@bessarabov commented on GitHub (Jul 18, 2013):

Yes. But what task we are solving with dividing this 2 things into 2 things? Why can't we only change MINOR part (and remove PATCH part from the standard).

In this idea changing MINOR part means that there is no backwards-incompatible changes.

What is the use for the end user to know what has been changed — was is new methods or there were some bug fixes?

@bessarabov commented on GitHub (Jul 18, 2013): Yes. But what task we are solving with dividing this 2 things into 2 things? Why can't we only change MINOR part (and remove PATCH part from the standard). In this idea changing MINOR part means that there is no backwards-incompatible changes. What is the use for the end user to know what has been changed — was is new methods or there were some bug fixes?
Author
Owner

@EddieGarmon commented on GitHub (Jul 18, 2013):

What is the use for the end user to know what has been changed — was is new methods or there were some bug fixes?

This.

Minor, means yes new features and maybe bug fixes
Patch, means only bug fixes

Some consumers do want to limit a specific dependent API version, but want all the latest bug fixes for that major.minor version

@EddieGarmon commented on GitHub (Jul 18, 2013): > What is the use for the end user to know what has been changed — was is new methods or there were some bug fixes? This. Minor, means yes new features and maybe bug fixes Patch, means only bug fixes Some consumers do want to limit a specific dependent API version, but want all the latest bug fixes for that major.minor version
Author
Owner

@taringamberini commented on GitHub (Jul 18, 2013):

Am I right that it does not matter for the end user what change it was — bugfix or some backwards compatible functionality is introduced?

If you see a Minor increment you might be interested in which new functionalities have been introduced or have been deprecated. The former might be useful to improve your code, the latter might be useful to estimate and/or plan refactoring of your code when a next Major increment will happen and such Major will remove the functionalities preceding deprecated.

Usually if a Patch increment occurs I surely will not be interested in improving my code or planning refactoring. Nevertheless you might be using an awful workaround because a bugged functionality, in that case you might be interested about when the bug will be fixed.

Discriminate between Minor an Patch lets you act differently.

@taringamberini commented on GitHub (Jul 18, 2013): > Am I right that it does not matter for the end user what change it was — bugfix or some backwards compatible functionality is introduced? If you see a Minor increment you might be interested in which new functionalities have been introduced or have been deprecated. The former might be useful to improve your code, the latter might be useful to estimate and/or plan refactoring of your code when a next Major increment will happen and such Major will remove the functionalities preceding deprecated. Usually if a Patch increment occurs I surely will not be interested in improving my code or planning refactoring. Nevertheless you might be using an awful workaround because a bugged functionality, in that case you might be interested about when the bug will be fixed. Discriminate between Minor an Patch lets you act differently.
Author
Owner

@bessarabov commented on GitHub (Jul 19, 2013):

@EddieGarmon Thank you for the patience for explaining everything to me =)

Some consumers do want to limit a specific dependent API version, but want all the latest bug fixes for that major.minor version

If I understood you correctly the consumer specifies that his product works with library that has x.y.z version, where x and y are some fixed numbers, and z can be any number. Ok. In this situation current version of SemVer make sense.

I'm awfully sorry, but still not not everything is clear for me. Why does the consumer wants to have x.y to be freezed? Why it is not enough for him to freeze only x part of the version?

@bessarabov commented on GitHub (Jul 19, 2013): @EddieGarmon Thank you for the patience for explaining everything to me =) > Some consumers do want to limit a specific dependent API version, but want all the latest bug fixes for that major.minor version If I understood you correctly the consumer specifies that his product works with library that has x.y.z version, where `x` and `y` are some fixed numbers, and `z` can be any number. Ok. In this situation current version of SemVer make sense. I'm awfully sorry, but still not not everything is clear for me. Why does the consumer wants to have `x.y` to be freezed? Why it is not enough for him to freeze only `x` part of the version?
Author
Owner

@EddieGarmon commented on GitHub (Jul 19, 2013):

In an enterprise IT organization, for example, this could just be the rule. This could be because of the vetting policies, or maybe just politics. The current spec is designed to support this type of scenario also. If there was no patch, then there would be people that would be impacted by organizational rules only allowing bug fixes to vetted dependencies. Most importantly to understand is that it is their choice and not something that we should mandate.

I suspect that in most cases, dependencies will be specified on the range [x.y, x+1) or [x.y.z, x+1), which says all non-breaking changes are allowed. But again, I'm speculating here.

@EddieGarmon commented on GitHub (Jul 19, 2013): In an enterprise IT organization, for example, this could just be the rule. This could be because of the vetting policies, or maybe just politics. The current spec is designed to support this type of scenario also. If there was no patch, then there would be people that would be impacted by organizational rules only allowing bug fixes to vetted dependencies. Most importantly to understand is that it is their choice and not something that we should mandate. I suspect that in most cases, dependencies will be specified on the range [x.y, x+1) or [x.y.z, x+1), which says all non-breaking changes are allowed. But again, I'm speculating here.
Author
Owner

@oberhamsi commented on GitHub (Jul 19, 2013):

Why does the consumer wants to have x.y to be freezed?

i feel @taringamberini already said it wellː a chanɡe in y - deprecation and new features - are more siɡnificant then a chanɡe in z. if dependencies chanɡe their y, the consumer should take a look at whats ɡoinɡ on and what direction thinɡs are takinɡ.

@oberhamsi commented on GitHub (Jul 19, 2013): > Why does the consumer wants to have x.y to be freezed? i feel @taringamberini already said it wellː a chanɡe in y - deprecation and new features - are more siɡnificant then a chanɡe in z. if dependencies chanɡe their y, the consumer should take a look at whats ɡoinɡ on and what direction thinɡs are takinɡ.
Author
Owner

@bessarabov commented on GitHub (Jul 20, 2013):

I want to thank everybody in this thread for explaining this matter to me. As I understood, the SemVer is designed to give the consumer several ways to manage deps.

@Haacked, @oberhamsi, @EddieGarmon, @taringamberini, Thank you! =)

@bessarabov commented on GitHub (Jul 20, 2013): I want to thank everybody in this thread for explaining this matter to me. As I understood, the SemVer is designed to give the consumer several ways to manage deps. @Haacked, @oberhamsi, @EddieGarmon, @taringamberini, Thank you! =)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#90