Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
cf5cd6b6
Commit
cf5cd6b6
authored
4 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
algo info header file generated via a matlab function
parent
f77a66ee
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gitinfointoso/writegitinfoheader.m
+65
-0
65 additions, 0 deletions
test/gitinfointoso/writegitinfoheader.m
with
65 additions
and
0 deletions
test/gitinfointoso/writegitinfoheader.m
0 → 100644
+
65
−
0
View file @
cf5cd6b6
function
writegitinfoheader
()
% first we get TCV current shot number, to be used for tagging
mdsconnect
(
'tcvdata'
);
curshot
=
mdsvalue
(
'current_shot("tcv_shot")'
);
% then we try to tag the current rtccode repo
tagname
=
[
'builds/TCV'
num2str
(
curshot
)];
str
=
sprintf
(
'Going to try this git tag: %s [(Y)es/(N)o/A(p)pend]?'
,
tagname
);
answ
=
input
(
str
,
's'
);
switch
upper
(
answ
)
case
'P'
nameapp
=
input
(
'Type what to append to tag name: '
,
's'
);
tagname
=
[
tagname
nameapp
];
case
'Y'
otherwise
return
end
tagmsg
=
input
(
'Type git tag message here: '
,
's'
);
tagcmd
=
[
'git tag '
tagname
' -m "'
tagmsg
'"'
];
answ
=
input
(
'Ok to tag [(Y)es/(N)o]?'
,
's'
);
switch
upper
(
answ
)
case
'Y'
otherwise
return
end
[
status
,
result
]
=
system
(
tagcmd
);
if
status
~=
0
fprintf
(
'could not tag, git error: \n%s\n'
,
result
);
return
end
taginfocmd
=
[
'git for-each-ref refs/tags/'
tagname
' --format="%(objectname) %(objecttype) %(refname) %(taggername) %(taggerdate) %(contents:subject)"'
];
[
status
,
result
]
=
system
(
taginfocmd
);
if
status
~=
0
fprintf
(
'could not retrieve tag info, git error: \n%s\n'
,
result
);
return
end
fprintf
(
'Code decription string will be set to:\n%s\n'
,
result
);
fd
=
fopen
(
'scdalgoinfo.h'
,
'w'
);
fprintf
(
fd
,
'/* scdalgoinfo.h */\n'
);
fprintf
(
fd
,
'/* generated on: %s */\n'
,
char
(
datetime
));
fprintf
(
fd
,
'\n'
);
fprintf
(
fd
,
'#ifndef SCDALGOINFO\n'
);
fprintf
(
fd
,
'#define SCDALGOINFO\n'
);
fprintf
(
fd
,
[
'#define ALGOINFOSTR "'
result
(
1
:
end
-
1
)
'"\n'
]);
fprintf
(
fd
,
[
'#define ALGOINFOLEN '
num2str
(
numel
(
result
))
'\n'
]);
fprintf
(
fd
,
'\n'
);
fprintf
(
fd
,
'struct algoinfo {\n'
);
fprintf
(
fd
,
' char text[ALGOINFOLEN];\n'
);
fprintf
(
fd
,
' unsigned int len;\n'
);
fprintf
(
fd
,
'}\n'
);
fprintf
(
fd
,
'\n'
);
fprintf
(
fd
,
'#endif\n'
);
fclose
(
fd
);
end
\ No newline at end of file
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