Skip to content

Commit ba200f7

Browse files
committed
FEAT/CHANGE: including GIT info in system/build
Before this commit, `system/build` was returning just a date, when the executable was compiled. Now it is an object, with keys `date` and `git`. If the executable is compiled from a valid git repository, `git` contains another object with info about actual `repository`, `branch`, `commit` and it's `message`. With this info it will be easier to localize possible regressions against older executables.
1 parent 6e8233f commit ba200f7

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/mezz/mezz-banner.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sys/boot-banner: make-banner [
5858
-
5959
= Version: system/version
6060
= Platform: system/platform
61-
= Build: system/build
61+
= Build: system/build/date
6262
= Warning: "For testing purposes only. Use at your own risk."
6363
-
6464
= Language: system/locale/language*

src/mezz/mezz-secure.r

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ protect-system-object: func [
188188

189189
"full protection:"
190190
protect/words/deep [
191+
system/build
191192
system/catalog
192193
;system/standard
193194
system/dialects

src/tools/make-boot.r

+27-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ REBOL [
1717
does most of the serious work. It generates most of the C include
1818
files required to compile REBOL.
1919
}
20+
Note: {
21+
Some code may look strange, but that is because this code may be evaluated
22+
by older bootstrap executables, which may be not fully functional!
23+
}
2024
]
2125

2226
print "--- Make Boot : System Embedded Script ---"
@@ -749,12 +753,34 @@ emit newline
749753

750754
at-value: func ['field] [next find boot-sysobj to-set-word field]
751755

756+
get-git: function[][
757+
git: none
758+
if exists? dir: %../../.git/ [
759+
try [
760+
git-head: read/string dir/HEAD
761+
?? git-head
762+
parse git-head [thru "ref:" any #" " copy git-head to lf]
763+
git: object [
764+
repository: none
765+
branch: find/reverse/tail tail probe git-head #"/"
766+
commit: trim/tail read/string dir/(git-head)
767+
message: trim/tail read/string dir/COMMIT_EDITMSG
768+
]
769+
try [
770+
git/repository: trim/tail read/string dir/description
771+
]
772+
?? git
773+
]
774+
]
775+
git
776+
]
777+
752778
boot-sysobj: load %sysobj.r
753779
change at-value version version
754780
when: now
755781
when: when - when/zone
756782
when/zone: 0:00
757-
change at-value build when
783+
change at-value build object [date: when git: get-git]
758784
change at-value product to lit-word! product
759785

760786

0 commit comments

Comments
 (0)