From 7241097da94dba82761f1228933c8e0ab77cff27 Mon Sep 17 00:00:00 2001
From: galperti <cristian.galperti@epfl.ch>
Date: Fri, 8 Jan 2021 16:57:28 +0100
Subject: [PATCH] tag forced, improved code ver message, todos added

---
 build/simulink_codegen/writegitinfoheader.m | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/build/simulink_codegen/writegitinfoheader.m b/build/simulink_codegen/writegitinfoheader.m
index 4a61de9..9dc392c 100644
--- a/build/simulink_codegen/writegitinfoheader.m
+++ b/build/simulink_codegen/writegitinfoheader.m
@@ -7,6 +7,14 @@ function writegitinfoheader()
    curshot=mdsvalue('current_shot("tcv_shot")');
    
    % then we try to tag the current rtccode repo 
+   
+   % TODO: check git repo cleanlyness, see script gittaglac
+   % TODO: clean build folders first, the generated .h is not
+   % checked for changes by the standard generated makefile
+   % it is enough to remove the primary model build folder
+   % (i.e. rm -rf SCD_rtccode_xx_xx*) so that submodels builds
+   % can be kept
+   
    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'); 
@@ -20,7 +28,7 @@ function writegitinfoheader()
    end
    
    tagmsg = input('Type git tag message here: ','s');
-   tagcmd = ['git tag ' tagname ' -m "' tagmsg '"'];
+   tagcmd = ['git tag -f ' tagname ' -m "' tagmsg '"'];
    
    answ = input('Ok to tag [(Y)es/(N)o]?','s');
    switch upper(answ)
@@ -36,7 +44,7 @@ function writegitinfoheader()
       return
    end
    
-   taginfocmd = ['git for-each-ref refs/tags/' tagname ' --format="%(objectname) %(objecttype) %(refname) %(taggername) %(taggerdate) %(contents:subject)"'];
+   taginfocmd = ['git for-each-ref refs/tags/' tagname ' --format="RTCCODE TAG HASH: %(objectname:short) CONTENTS: %(contents:subject) TAGGER: %(taggername) %(taggerdate) FULL TAG INFO: %(objecttype) %(refname) %(objectname)"'];
    [status,result] = system(taginfocmd); 
    
    if status~=0
-- 
GitLab