Skip to content

Commit

Permalink
FEAT: including last git commit version in the system/build/git and…
Browse files Browse the repository at this point in the history
… full version info when used `-v` boot argument
  • Loading branch information
Oldes committed Nov 8, 2021
1 parent 77a4276 commit 3a5f9e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions make/pre-make.r3
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ build-date: now/date
build-time: now/time build-time/second: 0
build-date/time: build-time


;- resolving current git commit
try/except [
parse read/string %../.git/HEAD [thru "ref: " copy git-header to lf]
git-commit: mold debase read/string join %../.git/ git-header 16
][ git-commit: none]

str-version: reform [
"Rebol" ; probably always same
product ; like Core, View, etc...
Expand All @@ -223,6 +230,7 @@ str-version: reform [
any [all [word? spec/compiler spec/compiler]] ; gcc, clang, msvc...
target
build-date
git-commit
]

ver3: version ver3/4: none ; trimmed version to just 3 parts
Expand Down
1 change: 1 addition & 0 deletions make/tools/make-boot.reb
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ emit [{
#define REBOL_UPD } any [version/3 0] {
#define REBOL_SYS } any [version/4 0] {
#define REBOL_VAR } any [version/5 0] {
#define REBOL_VERSION "} str-version {"
}]

;-- Generate Lower-Level String Table ----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/core/a-constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#define BP (REBYTE*)

const REBYTE Str_Banner[] = "REBOL 3 %d.%d.%d.%d.%d";
const REBYTE Str_Banner[] = "%s";

const char Str_REBOL[] = "REBOL";

Expand Down
2 changes: 1 addition & 1 deletion src/core/b-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extern const REBYTE Str_Banner[];
***********************************************************************/
{
if (rargs->options & RO_VERS) {
Debug_Fmt(Str_Banner, REBOL_VER, REBOL_REV, REBOL_UPD, REBOL_SYS, REBOL_VAR);
Debug_Fmt(Str_Banner, REBOL_VERSION);
OS_EXIT(0);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/mezz/sys-start.reb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ start: func [
system/build/compiler: ver/10
system/build/target: ver/11
system/build/date: ver/12
system/build/git: ver/13

if flags/verbose [system/options/log/rebol: 3] ;maximum log output for system messages

Expand Down

0 comments on commit 3a5f9e5

Please sign in to comment.