@@ -54,7 +54,7 @@ Current NUT SEMVER definition
5454Since NUT v2.8.3, the definition which goes into `AC_INIT` and further into
5555the code was extended in a manner similar to what `git describe` produces,
5656but with added numbers after the common triplet of semantically versioned
57- numbers: `X.Y.Z(.T(.B(-C+gHASH )))`
57+ numbers: `X.Y.Z(.T(.B(-C+H(+R))))` or `X.Y.Z(.T(.B(-R )))`
5858
5959* Standard semver (used in releases):
6060+
@@ -76,7 +76,15 @@ The optional suffix (only for commits which are not git tags themselves)
7676is provided by `git describe` :
7777
7878* C: Commits on branch since previous release tag
79- * H: Git hash (prefixed by `g` character) of the described commit
79+ * H: (Short) Git hash (prefixed by "g" character) of the described commit
80+
81+ The pre-release information (if provided/known) would either follow the
82+ optional suffix detailed above, or it would be the suffix itself:
83+
84+ * R: If this commit has a non-release tag, it can be optionally reported
85+ so we know that a commit some '1234' iterations after release 'N' is
86+ also a release candidate for 'N+1' . Note that any dash in that tag value
87+ will be replaced by a plus, e.g. `2.8.2.2878.1-2879+g882dd4b00+v2.8.3+rc6`
8088
8189 The numeric part of NUT SEMVER definition mostly follows https://semver.org/
8290except that for development iterations the base version may have up to
@@ -118,7 +126,8 @@ implementations).
118126 may be just a triplet) to this value and enforce
119127 `NUT_VERSION_PREFER_GIT=false` . Usually sourced
120128 from `${abs_top_srcdir}/VERSION_FORCED` (if present)
121- | `2.8.3.2379`
129+ | `2.8.2.2379` `2.8.3-rc3`
130+ `2.8.2.2878.3-2881+g45029249f+v2.8.3+rc6`
122131|`NUT_VERSION_FORCED_SEMVER` | Set `SEMVER` (exactly a triplet) to this value
123132 regardless of `NUT_VERSION_PREFER_GIT` setting. Usually
124133 sourced from `${abs_top_srcdir}/VERSION_FORCED_SEMVER`
@@ -210,18 +219,27 @@ implementations).
210219 numeric components as needed or dropping extras, to have
211220 *exactly 3* of them
212221 | `2.8.0`
213- |`VER5` and `DESC5` | Full 5-component version, `NUT_VERSION_DEFAULT5`
222+ |`SUFFIX` | Empty, unless `NUT_VERSION_DEFAULT` had a suffix
223+ for pre-release information roughly matching the
224+ `-(rc|alpha|beta)[0-9]*` regular expression
225+ | `""` `-rc6`
226+ |`VER5` | Full 5-component version, `NUT_VERSION_DEFAULT5`
214227 | `2.8.2.2379.2`
215- |`VER50` and `DESC50` | `NUT_VERSION_DEFAULT` as provided by caller or
228+ |`DESC5` | Constructed as `${VER5}${SUFFIX}`
229+ | `2.8.2.2379.2` `2.8.3.0.0-rc6`
230+ |`VER50` | `NUT_VERSION_DEFAULT` as provided by caller or
216231 defaulted, may be with or without trailing `.0` in fifth or
217232 fourth components
218233 | `2.8.2.1`
219- |`BASE` | Empty (no known common commits with no trunk) | `""`
220- |`SEMVER` | Exactly three leading numeric components.
234+ |`DESC50` | Constructed as `${VER50}${SUFFIX}`
235+ | `2.8.2.1` `2.8.3-rc6`
236+ |`BASE` | Empty (no known common commits with no trunk) | `""`
237+ |`SEMVER` | Exactly three leading numeric components.
221238 Either `NUT_VERSION_FORCED_SEMVER` (if provided by caller or
222239 configuration files), or `NUT_VERSION_DEFAULT3` (see above)
223240 | `2.8.0`
224- |`TAG` | Constructed as `v${NUT_VERSION_DEFAULT3}` | `v2.8.0`
241+ |`TAG` | Constructed as `v${NUT_VERSION_DEFAULT3}${SUFFIX}`
242+ | `v2.8.0` `v2.8.3-rc6`
225243|=========================================================================
226244
227245The majority of identified values can be reported for debugging to `stderr` ,
@@ -260,16 +278,40 @@ DESC='v2.8.2-2381+g1faa9945d'
260278|`IS_RELEASE` | `true` if `SEMVER` ==`VER50` , `false` otherwise
261279 | * dev: `false`
262280 * rel: `true`
281+ |`IS_PRERELEASE` | `true` if `SUFFIX_PRERELEASE` is not empty, `false` otherwise
282+ | * dev: `false`
283+ * rel/RC: `true`
263284|`TAG` | GIT: Nearest (annotated by default) tag preceding the `HEAD` in history.
264285 DEFAULT: Constructed from `SEMVER`
265286 | `v2.8.2`
287+ |`TAG_PRERELEASE` | GIT: if the `HEAD` itself has a tag matching
288+ the `-(rc|alpha|beta)[0-9]*` regular expression.
289+ DEFAULT: Constructed from `NUT_VERSION_DEFAULT3`
290+ and `SUFFIX_PRERELEASE` .
291+ Empty for not-pre-releases.
292+ | `v2.8.2-rc3` `""`
266293|`TRUNK` | GIT: Branch name used for calculation of current codebase
267294 distance from main development.
268295 DEFAULT: empty.
269296 | `master`
270297|`SUFFIX` | GIT: Commit count since the tag and hash of the `HEAD` commit
271- DEFAULT: empty.
298+ DEFAULT: empty for non-prerelease `NUT_VERSION_DEFAULT`
299+ values, or either value of `SUFFIX_PRERELEASE` with a
300+ leading dash for `NUT_VERSION_DEFAULT` values without
301+ git offset info (e.g. `2.8.3.5-rc6` => `-rc6` ), or the
302+ whole tail with git and pre-release tag info.
272303 | * dev: `-2381+g1faa9945d`
304+ * RC git: `-2381+g1faa9945d+v2.8.3+rc6`
305+ * RC default: `-rc6`
306+ |`SUFFIX_PRERELEASE` | GIT: Constructed from `TAG_PRERELEASE` replacing any
307+ dash with a plus character.
308+ DEFAULT: empty unless `NUT_VERSION_DEFAULT` has a
309+ suffix matching the `-(rc|alpha|beta)[0-9]*`
310+ regular expression, or git info followed by
311+ the pre-release tag.
312+ NOTE: No leading dash in this value (unlike `SUFFIX` ).
313+ | * RC git: `v2.8.3+rc6`
314+ * RC default: `rc6`
273315|`BASE` | GIT: Newest common commit of development `TRUNK` and the `HEAD`
274316 commit (their `git merge-base` ).
275317 DEFAULT: empty.
@@ -282,6 +324,11 @@ DESC='v2.8.2-2381+g1faa9945d'
282324 update the `VERSION_DEFAULT` file that goes into "dist"
283325 tarballs; prints its contents
284326 | `NUT_VERSION_DEFAULT='2.8.2.2379.2-2381+g1faa9945d'`
327+ |`UPDATE_FILE_GIT_RELEASE` | Used in maintainer rituals (requires git) to
328+ update the `VERSION_FORCED` and `VERSION_FORCED_SEMVER`
329+ files that go into "dist" tarballs; prints their contents
330+ | `NUT_VERSION_FORCED='2.8.2.2878.3-2881+g45029249f+v2.8.3+rc6'`
331+ `NUT_VERSION_FORCED_SEMVER='2.8.3'`
285332|default | Report `DESC50` | `v2.8.2-2381-g1faa9945d`
286333|=========================================================================
287334
@@ -318,6 +365,9 @@ Variables propagated by configure.ac
318365|`NUT_SOURCE_GITREV_IS_RELEASE`
319366 | Determined by `NUT_VERSION_QUERY=IS_RELEASE gitlog2version.sh`
320367 | `true` or `false`
368+ |`NUT_SOURCE_GITREV_IS_PRERELEASE`
369+ | Determined by `NUT_VERSION_QUERY=IS_PRERELEASE gitlog2version.sh`
370+ | `true` or `false`
321371|`NUT_SOURCE_GITREV_DEVREL`
322372 | String determined by `NUT_SOURCE_GITREV_IS_RELEASE`
323373 | `"release"` or `"development iteration"`
@@ -345,6 +395,11 @@ Variables propagated by nut_version.h
345395 (falls back to `false` if that query fails)
346396 | * `1` if `$GITREV_IS_RELEASE`
347397 * `0` otherwise
398+ |`#define NUT_VERSION_IS_PRERELEASE <0-or-1>`
399+ | Determined by `NUT_VERSION_QUERY=IS_PRERELEASE gitlog2version.sh`
400+ (falls back to `false` if that query fails)
401+ | * `1` if `$GITREV_IS_PRERELEASE`
402+ * `0` otherwise
348403|=========================================================================
349404
350405Use in C code
0 commit comments