-
I want to show that data currently stored in a version object is not sufficient for ordering them. For example, I compare official version 4.3.0beta1 and versions derived from git versions 4.3.0beta1-n-xxxxxxx from my own builds, where n is the number of commits to the master after the latest commit for beta1. If I would build my version from the same last commit after release of 4.3.0beta1 then the git version would be 4.3.0beta1-0-xxxxxxx. Method Version::current() in UtilsVersion.cpp would extract git revision 0 from -0- in the git version, hence the version is 4.3.0beta0. Even so (current is 4.3.0beta0)
is not true (as expected) because of the following code (since not both revisions are positive, the result is false):
But assume your own build to be one commit after release of 4.3.0beta2 then condition would be 4.3.0beta2 > 4.3.0beta1. We expect order to be false, but from the code it is true. No logic expression can resolve the problem, because it doesn't know if the 1 in beta1 is the revision or the git revision. In fact we do not know at all if git version was 4.3.0beta1-1 or 4.3.0beta2-1. If I'm right, then we would have to store n in a version object, and both type and revision. So we would have unified versions 4.3.0beta1-0 for the official version, and 4.3.0beta1-0 or 4.3.0beta1-1 or 4.3.0beta2-1 (s. examples) from the own builds (of which first one is identical to official one). What do you think? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
well, in case of alpha/beta/rc , revision of current version should be the number after the text "alpha", etc. |
Beta Was this translation helpful? Give feedback.
-
there is actually no reason to check the commits after. If there are no tags with a higher number, your version is at least up-to-date, so no info for the user needed. |
Beta Was this translation helpful? Give feedback.
there is actually no reason to check the commits after. If there are no tags with a higher number, your version is at least up-to-date, so no info for the user needed.
(And if you are checking out git, the whole update checker is kind of redundant)