Commit cb2b21a8 authored by jayd1860's avatar jayd1860
Browse files

-- Fix error in syncSubmodules in find date of last rev not working for git...

-- Fix error in syncSubmodules in find date of last rev not working for git added files and add progress bar when find latest rev
parent e6ef7f6a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ if ~exist('repo','var') || isempty(repo)
    repo = pwd;
end
repoFull = filesepStandard_startup(repo, 'full');
[~,f,e] = fileparts(repoFull(1:end-1));

h = waitbar(0, sprintf('Please wait for date of last rev for "%s" ...', [f,e]));

f1 = findTypeFiles(repoFull, '.m');
f2 = findTypeFiles(repoFull, '.txt');
@@ -13,15 +16,12 @@ f = [f1; f2; f3];

for ii = 1:length(f)
    pathrel = pathsubtract(f{ii}, repoFull);
    try
    [d, ds] = gitLastRevDate(repoFull, pathrel);
    if d>date
        date = d;
        dateS = ds;
    end
    catch
        d=1;
    end
    waitbar(ii / length(f), h)
end

close(h);
+8 −1
Original line number Diff line number Diff line
@@ -12,9 +12,16 @@ cmds{ii,1} = sprintf('cd %s', repoFull); ii = ii+1;
cmds{ii,1} = sprintf('git log -1 --format=%%ci --date=short %s', file);
[errs, msgs] = exeShellCmds(cmds, false, true);
if all(errs==0)
    c = str2cell(msgs{2}, ' ');
    if ~isempty(msgs{2})
        ds = msgs{2};
    else
        ds = char(datetime('now','TimeZone','local','Format','yyyy-MM-dd HH:mm:ss'));
    end
    c = str2cell(ds, ' ');
    
    dateS = c{1};
    timeS = c{2};

    dateS(dateS=='-')='';
    timeS(timeS==':')='';    
    
+1 −1

File changed.

Contains only whitespace changes.