Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rem
SRB2
Commits
5867b735
Commit
5867b735
authored
1 year ago
by
Logan Aerl Arias
Browse files
Options
Downloads
Patches
Plain Diff
add compnote support to comptime
add compnote support to comptime
parent
eca16a81
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
comptime.bat
+5
-2
5 additions, 2 deletions
comptime.bat
comptime.sh
+5
-3
5 additions, 3 deletions
comptime.sh
with
10 additions
and
5 deletions
comptime.bat
+
5
−
2
View file @
5867b735
@echo
off
set
BRA
=
Unknown
set
REV
=
illegal
set
GL1
=
Dummy
copy
nul
:
/b
+
%
1
\comptime.c
tmp
.$$$
>
nul
move
tmp
.$$$
%
1
\comptime.c
>
nul
...
...
@@ -13,8 +14,9 @@ goto filwri
:gitrev
set
GIT
=
%
2
if
"
%GIT%
"
==
""
set
GIT
=
git
for
/f
"usebackq"
%%s
in
(
`
%GIT%
rev-parse --abbrev-ref HEAD`
)
do
@set
BRA
=
%%s
for
/f
"usebackq"
%%s
in
(
`
%GIT%
rev-parse HEAD`
)
do
@set
REV
=
%%s
for
/f
"tokens=* usebackq"
%%s
in
(
`
%GIT%
rev-parse --abbrev-ref HEAD`
)
do
@set
BRA
=
%%s
for
/f
"tokens=* usebackq"
%%s
in
(
`
%GIT%
rev-parse HEAD`
)
do
@set
REV
=
%%s
for
/f
"tokens=* usebackq"
%%s
in
(
`
%GIT%
log -1 --format
^=
%%s
`
)
do
@set
GL1
=
%%s
set
REV
=
%REV
:
~
0
,
8
%
goto
filwri
...
...
@@ -30,3 +32,4 @@ echo // by the %0 batch file >> %1\comptime.h
echo
//
>>
%
1
\comptime.h
echo
const
char
*
compbranch
=
"
%BRA%
"
;
>>
%
1
\comptime.h
echo
const
char
*
comprevision
=
"
%REV%
"
;
>>
%
1
\comptime.h
echo
const
char
*
compnote
=
"
%GL1
%
"
;
>>
%
1
\comptime.h
This diff is collapsed.
Click to expand it.
comptime.sh
+
5
−
3
View file @
5867b735
...
...
@@ -12,24 +12,26 @@ version() {
//
const char* compbranch = "
$1
";
const char* comprevision = "
$2
";
const char* compnote = "
$3
";
EOF
}
versiongit
()
{
gitbranch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
gitversion
=
"
$(
git rev-parse HEAD |
cut
-c
-8
)
"
version
"
$gitbranch
"
"
$gitversion
"
;
gitsubject
=
"
$(
git log
-1
--format
=
%s
)
"
version
"
$gitbranch
"
"
$gitversion
"
"
$gitsubject
"
;
exit
0
}
versionsvn
()
{
svnrevision
=
"
$(
svnversion
-n
"
$1
"
)
"
version
"Subversion"
"r
$svnrevision
"
;
version
"Subversion"
"r
$svnrevision
"
"dummy"
;
exit
0
}
versionfake
()
{
version
"Unknown"
"illegal"
;
version
"Unknown"
"illegal"
"dummy"
;
}
compversion
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment