@@ -54,7 +54,7 @@ Current NUT SEMVER definition
54
54
Since NUT v2.8.3, the definition which goes into `AC_INIT` and further into
55
55
the code was extended in a manner similar to what `git describe` produces,
56
56
but 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 )))`
58
58
59
59
* Standard semver (used in releases):
60
60
+
@@ -76,7 +76,15 @@ The optional suffix (only for commits which are not git tags themselves)
76
76
is provided by `git describe` :
77
77
78
78
* 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`
80
88
81
89
The numeric part of NUT SEMVER definition mostly follows https://semver.org/
82
90
except that for development iterations the base version may have up to
@@ -118,7 +126,8 @@ implementations).
118
126
may be just a triplet) to this value and enforce
119
127
`NUT_VERSION_PREFER_GIT=false` . Usually sourced
120
128
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`
122
131
|`NUT_VERSION_FORCED_SEMVER` | Set `SEMVER` (exactly a triplet) to this value
123
132
regardless of `NUT_VERSION_PREFER_GIT` setting. Usually
124
133
sourced from `${abs_top_srcdir}/VERSION_FORCED_SEMVER`
@@ -210,18 +219,27 @@ implementations).
210
219
numeric components as needed or dropping extras, to have
211
220
*exactly 3* of them
212
221
| `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`
214
227
| `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
216
231
defaulted, may be with or without trailing `.0` in fifth or
217
232
fourth components
218
233
| `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.
221
238
Either `NUT_VERSION_FORCED_SEMVER` (if provided by caller or
222
239
configuration files), or `NUT_VERSION_DEFAULT3` (see above)
223
240
| `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`
225
243
|=========================================================================
226
244
227
245
The majority of identified values can be reported for debugging to `stderr` ,
@@ -260,16 +278,40 @@ DESC='v2.8.2-2381+g1faa9945d'
260
278
|`IS_RELEASE` | `true` if `SEMVER` ==`VER50` , `false` otherwise
261
279
| * dev: `false`
262
280
* rel: `true`
281
+ |`IS_PRERELEASE` | `true` if `SUFFIX_PRERELEASE` is not empty, `false` otherwise
282
+ | * dev: `false`
283
+ * rel/RC: `true`
263
284
|`TAG` | GIT: Nearest (annotated by default) tag preceding the `HEAD` in history.
264
285
DEFAULT: Constructed from `SEMVER`
265
286
| `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` `""`
266
293
|`TRUNK` | GIT: Branch name used for calculation of current codebase
267
294
distance from main development.
268
295
DEFAULT: empty.
269
296
| `master`
270
297
|`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.
272
303
| * 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`
273
315
|`BASE` | GIT: Newest common commit of development `TRUNK` and the `HEAD`
274
316
commit (their `git merge-base` ).
275
317
DEFAULT: empty.
@@ -282,6 +324,11 @@ DESC='v2.8.2-2381+g1faa9945d'
282
324
update the `VERSION_DEFAULT` file that goes into "dist"
283
325
tarballs; prints its contents
284
326
| `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'`
285
332
|default | Report `DESC50` | `v2.8.2-2381-g1faa9945d`
286
333
|=========================================================================
287
334
@@ -318,6 +365,9 @@ Variables propagated by configure.ac
318
365
|`NUT_SOURCE_GITREV_IS_RELEASE`
319
366
| Determined by `NUT_VERSION_QUERY=IS_RELEASE gitlog2version.sh`
320
367
| `true` or `false`
368
+ |`NUT_SOURCE_GITREV_IS_PRERELEASE`
369
+ | Determined by `NUT_VERSION_QUERY=IS_PRERELEASE gitlog2version.sh`
370
+ | `true` or `false`
321
371
|`NUT_SOURCE_GITREV_DEVREL`
322
372
| String determined by `NUT_SOURCE_GITREV_IS_RELEASE`
323
373
| `"release"` or `"development iteration"`
@@ -345,6 +395,11 @@ Variables propagated by nut_version.h
345
395
(falls back to `false` if that query fails)
346
396
| * `1` if `$GITREV_IS_RELEASE`
347
397
* `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
348
403
|=========================================================================
349
404
350
405
Use in C code
0 commit comments