Commit efac0203 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter
Browse files

added current git commit id to history on every itaSuper constructor

this will be the case on new itaAudios, or loaded ones. This will make itaAudios more reproducable in terms of toolbox version

the git hash is generated via system call and will return the current id of the master branch OR (in case of a different branch) the common ancestor of the current branch with the master branch.
this is done, in case work is done on a private branch.

Example History:
- Create Git hash
- ita_time_window
- Load Git hash
- ita_crop

parent 010a4c77
......@@ -156,6 +156,10 @@ classdef itaSuper < itaMeta
this(idx).mData = deal(nan(varargin{2})); %#ok<AGROW>
%% Add history line
commitID = ita_git_getMasterCommitHash;
this = ita_metainfo_add_historyline(this,'itaSuperGitVersion',commitID);
function commitID = ita_git_getMasterCommitHash
%ITA_GIT_GETMASTERCOMMITHASH - Get hash of last used master commit
% This function reads the git config and returns the hash of the last
% commit in the master branch
% The function is used in the to record the toolbox commit
% which was used to create the ita file
% Syntax:
% commitID = ita_git_getMasterCommitHash()
% See also:
% Reference page in Help browser
% <a href="matlab:doc ita_git_read_config">doc ita_git_read_config</a>
% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved.
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder.
% </ITA-Toolbox>
% Author: Jan-Gerrit Richter -- Email:
% Created: 13-Sep-2017
commitID = '';
workingDir = pwd;
[~,commitID] = system('git merge-base master HEAD');
commitID = strrep(commitID,sprintf('\n'),'');
catch e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment