Skip to content
Snippets Groups Projects
Commit 90b6e858 authored by Cristian Galperti's avatar Cristian Galperti
Browse files

writegitinfo checks for clean working copy

parent 7241097d
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,22 @@ function writegitinfoheader() ...@@ -2,6 +2,22 @@ function writegitinfoheader()
% max description length % max description length
maxdesclen=1024; maxdesclen=1024;
% Git checks first
% 1) check repo cleanlyness
% TODO: check that the output of 'git status -procelain' is empty
[~,result] = system('git status --porcelain');
if ~isempty(result)
error('the working copy is not clean, please commit changes first.');
end
% 2) check local and remote hash are matching (in synch working copy)
[~,localhash] = system('git rev-parse @');
[~,remotehash] = system('git rev-parse @{u}');
if ~strcmp(localhash, remotehash)
error('the working copy is not in sync with its origin, please push first.');
end
% first we get TCV current shot number, to be used for tagging % first we get TCV current shot number, to be used for tagging
mdsconnect('tcvdata'); mdsconnect('tcvdata');
curshot=mdsvalue('current_shot("tcv_shot")'); curshot=mdsvalue('current_shot("tcv_shot")');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment