I've been thinking about semantic versioning recently and thought of a hypothetical situation that I can't quite seem to reconcile.
My understanding of the Semantic Versioning Scheme is as follows:
A particular unique state of computer software can be identified with a 3-part version number of the form:
M.m.p
Where
- M = Major #
- m = Minor #
- p = patch #
A major change is any change to the software such that the new version with the change is no longer compatible with the previous version before the change. A minor change is any feature added or removed from the software that does not compromise compatibility with its previous version before the change. and any change that fixes a bug or error is just a patch change. Whenever a major change occurs M is incremented and m and p are reset back to 0. Similarly when a minor change occurs m is incremented and p is reset back to 0. and patch changes merely increment p
(I know there are additional components of semantic versioning like -alpha, -beta and so on but for now I am keeping it simple and constrained to the above)
The Hypothetical situation that is confusing me is this:
Suppose a software project exists in a certain state X.Y.Z in a repository of a version control system (for the sake of the hypothetical lets assume this is Git/GitHub). Suppose there are two developer A and B for the software project. Each clones down a copy of the software project in state X.Y.Z in order to work on some change for it, both are working on a different change (they may be of the same type - M/m/p but the content is different).
Now suppose that developer A finishes their change (whether it be major, minor or patch) and pushes it to the repository (thereby changing the state of the software project to (X.Y.Z)+1 [again we don't know the nature of the change here]). And suppose they do this before developer B is finished with their changes.
How should this influence the work flow of developer B?
if A's change was just a patch should developer B just ignore the update and continue working on their change as if nothing happened (especially if their change was major)?
if A's change was minor or major should developer B scrap whatever progress they've made on their change and start over on the assumption that A's change will have influence on theirs (B's)?
With the nature of problem outline above how should updating semantic versions be handled between multiple developers?