From 2b090095eb5e16132f34810efa90d7dfe755147b Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 23 May 2017 16:49:03 +0200 Subject: [PATCH 001/163] Pull changes from fork before updating --- src/updateFork.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/updateFork.m b/src/updateFork.m index ee8b31e..99f7c65 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -97,6 +97,14 @@ function updateFork(force) if length(commitsAheadBehind) > 0 && commitsAheadBehind(2) > 0 + [status_gitPull, result_gitPull] = system(['git pull origin ', branches{k}]); + if status_gitPull == 0 + printMsg(mfilename, ['The <', branches{k}, '> feature (branch) of the fork could not be pulled.']); + else + fprintf(result_gitPull); + error([gitCmd.lead, ' [', mfilename,'] Impossible to pull changes from the <', branches{k}, '> feature (branch) of the fork.', gitCmd.fail]); + end + if ~force % merge the changes from upstream to the branch [status_gitMergeUpstream, result_gitMergeUpstream] = system(['git merge upstream/', branches{k}]); From 308c3c7a6a6eb6bcefb51b920515774266c50e72 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 23 May 2017 18:25:05 +0200 Subject: [PATCH 002/163] Change from verbose to printLevel --- FAQ.md | 6 +++--- README.md | 4 ++-- assets/confDevTools.m | 6 +++--- contribute.m | 13 +++++++++---- src/checkSystem.m | 16 ++++++++-------- src/checkoutBranch.m | 6 +++--- src/deleteContribution.m | 2 +- src/initContribution.m | 2 +- src/initDevTools.m | 2 +- src/openPR.m | 2 +- src/printMsg.m | 2 +- src/submitContribution.m | 2 +- test/testCheckSystem.m | 4 ++-- 13 files changed, 36 insertions(+), 31 deletions(-) diff --git a/FAQ.md b/FAQ.md index 7b8735e..8161b4c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -16,13 +16,13 @@ where `` corresponds to the installation of `MATLAB`, Once you submit your contribution (menu item 3), you will be presented with a link that leads you directly to the pull request (PR). -## Turn on the verbose mode +## Print more detailed debugging information (verbose) If you encounter a problem, or suspect that something is not behaving properly, please run: ``` ->> contribute(true) +>> contribute(1) ``` -and follow the process as normally. You can also set `gitConf.verbose = true;` in `assets/confDevTools.m`. +and follow the process as normally. This will set `printLevel = 1`. You can also set permanently `gitConf.printLevel = 1;` in `assets/confDevTools.m`. ## Resolve unexpected behavior - reset diff --git a/README.md b/README.md index af1872f..0a907ec 100644 --- a/README.md +++ b/README.md @@ -66,11 +66,11 @@ If you want to use the `MATLAB.devTools` with a repository other than the defaul launcher = '\n\n ~~~ MATLAB.devTools ~~~\n\n'; % a message for the repository (any string) remoteRepoURL = 'https://server.com/repositoryName.git'; % the remote url nickName = 'repoNickName'; % a nickName of the repository (any string) -verbose = false; % turn the verbose mode on (true) or off (false) +printLevel = 0; % set the printLevel mode ``` and run: ```Matlab ->> confDevTools(launcher, remoteRepoURL, nickName, verbose); % sets the configuration +>> confDevTools(launcher, remoteRepoURL, nickName, printLevel); % sets the configuration ``` In order to reset the configuration, type: diff --git a/assets/confDevTools.m b/assets/confDevTools.m index 9310add..5e0a71f 100644 --- a/assets/confDevTools.m +++ b/assets/confDevTools.m @@ -1,4 +1,4 @@ -function confDevTools(launcher, remoteRepoURL, nickName, verbose) +function confDevTools(launcher, remoteRepoURL, nickName, printLevel) % devTools % % PURPOSE: define the configuration of the devTools @@ -12,12 +12,12 @@ function confDevTools(launcher, remoteRepoURL, nickName, verbose) gitConf.exampleBranch = 'add-constraints'; if nargin < 4 % default values - gitConf.verbose = false; + gitConf.printLevel = 0; gitConf.launcher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; gitConf.remoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; gitConf.nickName = 'cobratoolbox'; else - gitConf.verbose = verbose; + gitConf.printLevel = printLevel; gitConf.launcher = launcher; gitConf.remoteRepoURL = remoteRepoURL; gitConf.nickName = nickName; diff --git a/contribute.m b/contribute.m index f51f371..93d1916 100644 --- a/contribute.m +++ b/contribute.m @@ -1,4 +1,4 @@ -function contribute(verbose) +function contribute(printLevel) % devTools % % PURPOSE: displays a menu and calls the respective subfunctions @@ -7,6 +7,11 @@ function contribute(verbose) % 2. Select an existing feature (branch) to work on. % 3. Publish a feature (branch). % 4. Delete a feature (branch). +% +% INPUT: +% +% printLevel: 0: minimal printout (default) +% 1: detailed printout (debug mode) global gitConf global gitCmd @@ -21,10 +26,10 @@ function contribute(verbose) checkSystem(mfilename); if nargin > 0 - if verbose - gitConf.verbose = verbose; + if printLevel > 0 + gitConf.printLevel = printLevel; else - gitConf.verbose = false; + gitConf.printLevel = 0; end end diff --git a/src/checkSystem.m b/src/checkSystem.m index 85c576f..6f0585f 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -11,21 +11,21 @@ function checkSystem(callerName) if isempty(gitConf) confDevTools(); else - confDevTools(gitConf.launcher, gitConf.remoteRepoURL, gitConf.nickName, gitConf.verbose); + confDevTools(gitConf.launcher, gitConf.remoteRepoURL, gitConf.nickName, gitConf.printLevel); end % set the callerName if nargin < 1 callerName = ''; - verbose = true; + printLevel = 1; else - verbose = false; + printLevel = 0; callerName = ['(caller: ', callerName, ')']; end - if verbose - gitConfVerbose = gitConf.verbose; - gitConf.verbose = true; + if printLevel > 0 + gitConfprintLevel = gitConf.printLevel; + gitConf.printLevel = 1; end % check if git is properly installed @@ -47,7 +47,7 @@ function checkSystem(callerName) error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); end - if verbose - gitConf.verbose = gitConfVerbose; + if printLevel > 0 + gitConf.printLevel = gitConfprintLevel; end end diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 39b3de6..808c674 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -56,7 +56,7 @@ function checkoutBranch(branchName, update_fork) % reset the develop branch [status_gitReset, result_gitReset] = system('git reset --hard upstream/develop'); if status_gitReset == 0 - if gitConf.verbose + if gitConf.printLevel > 0 fprintf([gitCmd.lead, ' [', mfilename, '] The current feature (branch) is .', gitCmd.success, gitCmd.trail]); end else @@ -161,13 +161,13 @@ function checkoutBranch(branchName, update_fork) end end else - if gitConf.verbose + if gitConf.printLevel > 0 fprintf(result_gitCheckout); fprintf([gitCmd.lead, ' [', mfilename, '] The feature (branch) <', branchName, '> could not be checked out.', gitCmd.fail, gitCmd.trail]); end end else - if gitConf.verbose && ~strcmp(branchName, currentBranch) + if gitConf.printLevel > 0 && ~strcmp(branchName, currentBranch) fprintf(result_gitStatus); fprintf([gitCmd.lead, ' [', mfilename, '] Uncommited changes of the current feature (branch) <', currentBranch, '> have been migrated to the new feature <', branchName, '>.', gitCmd.success, gitCmd.trail]); end diff --git a/src/deleteContribution.m b/src/deleteContribution.m index bd18996..cca205a 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -10,7 +10,7 @@ function deleteContribution(branchName) % change the directory to the local directory of the fork cd(gitConf.fullForkDir); - if gitConf.verbose + if gitConf.printLevel > 0 originCall = [' [', mfilename, '] ']; else originCall = ''; diff --git a/src/initContribution.m b/src/initContribution.m index f54a276..d47c5dc 100644 --- a/src/initContribution.m +++ b/src/initContribution.m @@ -10,7 +10,7 @@ function initContribution(branchName) % initialize the development tools initDevTools(); - if gitConf.verbose + if gitConf.printLevel > 0 originCall = [' [', mfilename, '] ']; else originCall = ''; diff --git a/src/initDevTools.m b/src/initDevTools.m index 8fc14d0..3aaaf9e 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -22,7 +22,7 @@ function initDevTools() [status_gitConfUserGet, result_gitConfUserGet] = system('git config --get user.github-username'); gitConf.userName = strtrim(result_gitConfUserGet); - if gitConf.verbose + if gitConf.printLevel > 0 originCall = [' [', mfilename, '] ']; else originCall = ''; diff --git a/src/openPR.m b/src/openPR.m index d71381b..ef01d36 100644 --- a/src/openPR.m +++ b/src/openPR.m @@ -10,7 +10,7 @@ function openPR(branchName) % change the directory to the local directory of the fork cd(gitConf.fullForkDir); - if gitConf.verbose + if gitConf.printLevel > 0 originCall = [' [', mfilename, '] ']; else originCall = ''; diff --git a/src/printMsg.m b/src/printMsg.m index 8e790a1..1c58400 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -11,7 +11,7 @@ function printMsg(fileName, msg, endMsg) endMsg = [gitCmd.success, gitCmd.trail]; end - if gitConf.verbose + if gitConf.printLevel > 0 fprintf([gitCmd.lead, ' [', fileName, '] ', msg, endMsg]); end end diff --git a/src/submitContribution.m b/src/submitContribution.m index 4a7612c..22b9e8b 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -13,7 +13,7 @@ function submitContribution(branchName) % check if branch exists checkoutBranch(branchName); - if gitConf.verbose + if gitConf.printLevel > 0 originCall = [' [', mfilename, '] ']; else originCall = ''; diff --git a/test/testCheckSystem.m b/test/testCheckSystem.m index 0ffec65..4b62c67 100644 --- a/test/testCheckSystem.m +++ b/test/testCheckSystem.m @@ -5,13 +5,13 @@ launcher = '\n\n ~~~ MATLAB.devTools ~~~\n\n'; remoteRepoURL = 'https://github.com/uni-lu/MATLAB.devTools.CI.git'; nickName = 'MATLAB.devTools.CI'; -verbose = true; +printLevel = 1; % reset the development tools resetDevTools(); % set the configuration -confDevTools(launcher, remoteRepoURL, nickName, verbose); +confDevTools(launcher, remoteRepoURL, nickName, printLevel); % check the system checkSystem(); From 3a2f852f96b12b15ba20b6491fc1dedf29651596 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 1 Jun 2017 18:30:23 +0200 Subject: [PATCH 003/163] WIP: fix in updateSubmodules --- src/updateSubmodules.m | 48 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/src/updateSubmodules.m b/src/updateSubmodules.m index c1ddddf..463c166 100644 --- a/src/updateSubmodules.m +++ b/src/updateSubmodules.m @@ -17,8 +17,8 @@ function updateSubmodules() error([gitCmd.lead, ' [', mfilename,'] Your global git configuration could not be changed.', gitCmd.fail]); end - % Update/initialize submodules - [status_gitSubmodule, result_gitSubmodule] = system('git submodule update --init'); + % initialize submodules + [status_gitSubmodule, result_gitSubmodule] = system('git submodule init'); if status_gitSubmodule == 0 printMsg(mfilename, 'The submodules have been initialized.'); @@ -27,13 +27,43 @@ function updateSubmodules() error([gitCmd.lead, ' [', mfilename,'] The submodules could not be initialized.', gitCmd.fail]); end - % reset each submodule - [status_gitReset result_gitReset] = system('git submodule foreach --recursive git reset --hard'); - if status_gitReset == 0 - printMsg(mfilename, 'The submodules have been reset.'); - else - fprintf(result_gitReset); - error([gitCmd.lead, ' [', mfilename,'] The submodules could not be reset.', gitCmd.fail]); + % retrieve the count for each submodule + [status_gitSubmoduleCount, result_gitSubmoduleCount] = system('git submodule foreach --recursive git rev-list --count origin/master...HEAD'); + + % split the array at line breaks + arrResult = regexp(result_gitSubmoduleCount,'\n+','split'); %strsplit is not compatible with older versions of MATLAB + arrResult = strtrim(arrResult); + + % filter out the empty ones + arrResult = arrResult(~cellfun(@isempty, arrResult)); + + % calculate the total number of changes + sumChanges = 0; + nSubmodules = length(arrResult)/2; + for k = 1:nSubmodules + sumChanges = sumChanges + str2num(arrResult{2*k}); + end + + % update the submodules + if sumChanges > 0 + % update submodules + [status_gitSubmodule, result_gitSubmodule] = system('git submodule update'); + + if status_gitSubmodule == 0 + printMsg(mfilename, 'The submodules have been initialized.'); + else + fprintf(result_gitSubmodule); + error([gitCmd.lead, ' [', mfilename,'] The submodules could not be initialized.', gitCmd.fail]); + end + + % reset each submodule + [status_gitReset result_gitReset] = system('git submodule foreach --recursive git reset --hard'); + if status_gitReset == 0 + printMsg(mfilename, 'The submodules have been reset.'); + else + fprintf(result_gitReset); + error([gitCmd.lead, ' [', mfilename,'] The submodules could not be reset.', gitCmd.fail]); + end end % restore global configuration by unsetting http.sslVerify From ac79e46ead0899574ddf13250e0015dc41b13539 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 4 Jul 2017 15:14:50 -0700 Subject: [PATCH 004/163] WIP: updateFork --- src/updateFork.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/updateFork.m b/src/updateFork.m index 99f7c65..1fcff61 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -90,12 +90,15 @@ function updateFork(force) end % determine the number of commits that the local master branch is behind - [status_gitCount, result_gitCount] = system(['git rev-list --left-right --count ', branches{k}, '...upstream/', branches{k}]); + [status_gitCountUpstream, result_gitCountUpstream] = system(['git rev-list --left-right --count ', branches{k}, '...upstream/', branches{k}]); - if status_gitCount == 0 - commitsAheadBehind = str2num(char(strsplit(result_gitCount))); + [status_gitCountOrigin, result_gitCountOrigin] = system(['git rev-list --left-right --count ', branches{k}, '...origin/', branches{k}]); - if length(commitsAheadBehind) > 0 && commitsAheadBehind(2) > 0 + if status_gitCountUpstream == 0 && status_gitCountOrigin == 0 + commitsAheadBehindUpstream = str2num(char(strsplit(result_gitCountUpstream))); + commitsAheadBehindOrigin = str2num(char(strsplit(result_gitCountOrigin))); + + if (length(commitsAheadBehindUpstream) > 0 && commitsAheadBehindUpstream(2) > 0) || (length(commitsAheadBehindOrigin) > 0 && commitsAheadBehindOrigin(1) > 0) [status_gitPull, result_gitPull] = system(['git pull origin ', branches{k}]); if status_gitPull == 0 From 73e643cf978d36a0b815bc7e89ba6e738f02d309 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 6 Jul 2017 23:45:38 -0700 Subject: [PATCH 005/163] Mentioning no passphrase in SSH key --- FAQ.md | 31 +++++++++++++++++++++++-------- PREREQUISITES.md | 25 +++++++++++++------------ 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/FAQ.md b/FAQ.md index 7b8735e..c789502 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,5 +1,20 @@ # Frequently Asked Questions (FAQ) +## I receive a `Permission denied` error. What can I do? + +You may encounter the following error: +``` +Permission denied (publickey) +fatal: could not read from the repository. + +Please make sure you have the correct access rights +and the repository exists. +``` + +This error can have multiple reasons, but most likely, the SSH key is not configured properly. Please follow the [configuration instructions](https://github.com/opencobra/MATLAB.devTools/blob/master/PREREQUISITES.md) carefully. + +Another source of this error may be that you have set a passphrase when generating the SSH key. Please leave the passphrase empty when generating the SSH key. + ## Mismatch of the version of `openSSL` (Linux) You might be in the situation that you receive the following error: @@ -12,27 +27,27 @@ sudo mv /bin/glnxa64/libcrypto.so.1.0.0 ` corresponds to the installation of `MATLAB`, e.g., `/usr/local/MATLAB/R2016b` -## How do I submit a Pull Request? +## How do I submit a Pull Request (PR)? -Once you submit your contribution (menu item 3), you will be presented with a link that leads you directly to the pull request (PR). +Once you submit your contribution (menu option [3]), you will be presented with a link that leads you directly to the pull request (PR). ## Turn on the verbose mode If you encounter a problem, or suspect that something is not behaving properly, please run: -``` ->> contribute(true) +```Matlab +>> contribute(1) ``` and follow the process as normally. You can also set `gitConf.verbose = true;` in `assets/confDevTools.m`. ## Resolve unexpected behavior - reset -If you encounter unexpected behavior, please try to reset the `devTools` with: -``` +If you encounter unexpected behavior, please try to reset the `MATLAB.devTools` with: +```Matlab >> resetDevTools ``` If you have files or changes that appear and would like to reset your local fork (without re-cloning) again, type: -``` +```Matlab >> resetLocalFork ``` @@ -47,6 +62,6 @@ Initiate a contribution per theme/topic/feature/bug fix that you work on. Don't ## How can I check the history of a file? You can check the history of a file by typing in MATLAB: -``` +```Matlab >> history('fileName.m') ``` diff --git a/PREREQUISITES.md b/PREREQUISITES.md index f923a81..ac3c28d 100644 --- a/PREREQUISITES.md +++ b/PREREQUISITES.md @@ -15,6 +15,7 @@ If you don't have yet an SSH key (see previous step), you have to generate one ( ```` $ ssh-keygen -t rsa -C "first.last@server.com" ```` +warning Leave the passphrase empty when generating the SSH key. - **Add the SSH** to [your Github account](https://github.com/settings/keys) by following the steps [here](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/). @@ -22,11 +23,11 @@ $ ssh-keygen -t rsa -C "first.last@server.com" Please ensure that you have a working `MATLAB` installation. -You can check if you have a working installation of `git` by typing in the terminal (or GUI Bash): +You can check if you have a working installation of `git` by typing in the `Terminal` (on `linux` and `macOS`) or `cmd` (in `Windows`, not `Git Bash`): ```bash $ git --version ``` -This will return `git version 2.10.1 [...]` or similar with another version number. +If installed properly, this will return `git version 2.13.1 [...]` or similar with another version number. You can then check if your `git` is properly configured by typing in the terminal (or GUI Bash): ```bash @@ -37,16 +38,24 @@ which will return your Github username if everything is properly set up. Similar $ git config --get user.email ``` -You can check if you have a working installation of `curl` by typing in the terminal (or GUI Bash): +You can check if you have a working installation of `curl` by typing in the terminal (`cmd` on Windows, not `Git Bash`): ```bash $ curl --version ``` -which will return `curl 7.51.0 [...]` or similar with another version number. +which will return `curl 7.51.0 [...]` or similar with another version number if installed properly. ## System configuration You must have `git` and `curl` installed. Please also ensure that you have `MATLAB` [installed](https://nl.mathworks.com/help/install/). +**Windows** + +Please download the `git` tools for Windows from [here](https://git-scm.com/download/win). During the installation process, please ensure that you select **Use Git Bash and optional Unix tools from the Windows Command prompt**. In addition, please make sure that you select **Checkout as-is, commit Unix-style line endings**. + +
+   . +
+ **Linux (Ubuntu or Debian)** ```bash @@ -57,14 +66,6 @@ $ sudo apt-get install git-all curl In order to install `git`, install the [Xcode Command Line Tools](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/). For `curl`, follow the instructions [here](http://macappstore.org/curl/). -**Windows** - -Please download the `git` tools for Windows from [here](https://git-scm.com/download/win). During the installation process, please ensure that you select **Use Git Bash and optional Unix tools from the Windows Command prompt**. In addition, please make sure that you select **Checkout as-is, commit Unix-style line endings**. - -
-   . -
- ## Github and local `git` configuration If you don't have a GitHub account, please sign up [here](https://github.com/join). For the very first time, you must **fork** the repository of The COBRA Toolbox. Browse to the [original repository](https://github.com/opencobra/cobratoolbox) and click on the button From f6e9e6aa01c5f5f8422ee2d4efaab51e2af4a2c9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 7 Jul 2017 00:38:08 -0700 Subject: [PATCH 006/163] More stringent requirements for commit message --- src/submitContribution.m | 44 +++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index 4a7612c..04c89da 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -150,14 +150,48 @@ function submitContribution(branchName) if countAddFiles > 0 fprintf([gitCmd.lead, originCall, 'You have selected ', num2str(countAddFiles), ' files to be added in one commit.', gitCmd.trail]); - commitMsg = input([gitCmd.lead, originCall, ' -> Please enter a commit message (example: "Fixing bug with input arguments"): '], 's'); + % define prohibited sequences + dictFlags = {'yy', 'nn', 'commit', 'abc'}; - if ~isempty(commitMsg) + % initialize loop flag + incorrectCommitMsg = true; - if ~strcmp(commitMsg(1), '"') || ~strcmp(commitMsg(end), '"') - commitMsg = ['"', commitMsg, '"']; + % loop as long as the commit message is not correct + while incorrectCommitMsg + % ask the user for a commit message + commitMsg = input([gitCmd.lead, originCall, ' -> Please enter a commit message (example: "Fixing bug with input arguments"): '], 's'); + + % omit non literal characters + commitMsg = regexprep(commitMsg, '[^a-zA-Z0-9_-?! ]', ''); + + % trim the commitMsg + commitMsg = strtrim(commitMsg); + + % add double quotes to the commit message if not set + if isempty(commitMsg) + incorrectCommitMsg = true; + else + if ~strcmp(commitMsg(1), '"') || ~strcmp(commitMsg(end), '"') + commitMsg = ['"', commitMsg, '"']; + end end + % NOTE: anything below assumes "commitMsg" + + % if the commit message is not empty and minimum 5 characters (+2 quotes) + for k = 1:length(dictFlags) + if length(commitMsg) >= 5+2 && isempty(strfind(commitMsg, dictFlags{k})) + incorrectCommitMsg = false; + continue; + else + incorrectCommitMsg = true; + break; + end + end + end + + % set the commit message + if ~incorrectCommitMsg [status_gitCommit, result_gitCommit] = system(['git commit -m', commitMsg]); fprintf([gitCmd.lead, originCall, 'Your commit message has been set.', gitCmd.success, gitCmd.trail]); if status_gitCommit == 0 @@ -167,7 +201,7 @@ function submitContribution(branchName) error([gitCmd.lead, ' [', mfilename,'] Your commit message cannot be set.', gitCmd.fail]); end else - error([gitCmd.lead, ' [', mfilename,'] Please enter a commit message that has more than 10 characters.', gitCmd.fail]); + error([gitCmd.lead, ' [', mfilename,'] Your commit message was not accepted.', gitCmd.fail]); end end From 48d3989dfceb3dac7b7fa3af760072a8dcad0ed2 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 7 Jul 2017 01:29:20 -0700 Subject: [PATCH 007/163] Save path to local git configuration --- src/initDevTools.m | 25 ++++++++++++++++++++++--- src/resetDevTools.m | 14 ++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 8fc14d0..dcf3859 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -69,11 +69,15 @@ function initDevTools() end end + % retrieve the directory of the fork from the local git configuration + [~, result_gitConfForkDirGet] = system(['git config --get user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); + gitConf.fullForkDir = strtrim(result_gitConfForkDirGet); + % check if the fork exists remotely checkRemoteFork(); - % request the local directory - if isempty(gitConf.localDir) + % request the local directory if the fullForkDir is not yet known + if isempty(gitConf.localDir) && isempty(gitConf.fullForkDir) createDir = false; @@ -91,7 +95,12 @@ function initDevTools() gitConf.localDir = strrep([gitConf.localDir, filesep], '\', '\\'); end - % warn the user of not using a fork-cobratoolbox or cobratoolbox directory as it will be cloned + % strip the fork-nickName folder from the localDir if present + if strcmp(gitConf.localDir(end-length(gitConf.forkDirName)+1:end), gitConf.forkDirName) + gitConf.localDir = gitConf.localDir(1:end-length(gitConf.forkDirName)); + end + + % warn the user of not using a fork-nickName directory or a git cloned directory as it will be cloned if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) || exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains the nickname or a .git folder reply = input([gitCmd.trail, gitCmd.lead, originCall, ' -> The specified directory already contains a ', gitConf.nickName, ' copy (clone) or is a git directory.', ... gitCmd.trail, gitCmd.lead, originCall, ' -> Please provide the directory into which your fork should be cloned. Do you want to continue? Y/N [Y]:'], 's'); @@ -123,6 +132,15 @@ function initDevTools() gitConf.forkDirName = strrep([gitConf.leadForkDirName, gitConf.remoteRepoName], '\', '\\'); gitConf.fullForkDir = strrep([gitConf.localDir, gitConf.forkDirName], '\', '\\'); + % permanently store the fork directory in the git configuration (ask the user explicitly) + [status_gitConfForkDirSet, result_gitConfForkDirSet] = system(['git config --global user.', gitConf.leadForkDirName, gitConf.nickName, '.path "', gitConf.fullForkDir, '"']); + if status_gitConfForkDirSet == 0 + fprintf([gitCmd.lead, originCall, 'Your fork directory has been set to: ', gitConf.fullForkDir, '. ', gitCmd.success, gitCmd.trail]); + else + fprintf(result_gitConfForkDirSet); + error([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be set.', gitCmd.fail]); + end + % clone the fork freshClone = cloneFork(); @@ -149,6 +167,7 @@ function initDevTools() % print the current configuration fprintf([gitCmd.lead, originCall, ' -- Configuration -------- ', gitCmd.trail]) fprintf([gitCmd.lead, originCall, ' GitHub username: ', gitConf.userName, gitCmd.trail]); + fprintf([gitCmd.lead, originCall, ' GitHub email: ', gitConf.userEmail, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Local directory : ', gitConf.fullForkDir, gitCmd.trail]) fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); diff --git a/src/resetDevTools.m b/src/resetDevTools.m index ced660f..cffa144 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -10,14 +10,24 @@ function resetDevTools() % call checkSystem to set default values for gitConf and gitCmd checkSystem(mfilename); + % unset the path to the local fork + [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset-all user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); + + if status_gitConfForkDirGet == 0 + printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); + else + fprintf(result_gitConfForkDirGet); + fprintf([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + end + % unset the user name [status_gitConfUserGet, result_gitConfUserGet] = system('git config --global --unset-all user.github-username'); if status_gitConfUserGet == 0 - printMsg(mfilename, 'Your Github username has been removed.'); + printMsg(mfilename, 'Your Github username has been removed from your local git configuration.'); else fprintf(result_gitConfUserGet); - fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed.', gitCmd.fail, gitCmd.trail]); + fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); end clear global gitConf; From 8a0d17f2412d695fa540db38751446eb0062d263 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 7 Jul 2017 15:50:45 +0100 Subject: [PATCH 008/163] Fix bug of forkDirName --- src/initDevTools.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index ce69dcc..af80f91 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -69,6 +69,9 @@ function initDevTools() end end + % define the name of the local fork directory + gitConf.forkDirName = strrep([gitConf.leadForkDirName, gitConf.remoteRepoName], '\', '\\'); + % retrieve the directory of the fork from the local git configuration [~, result_gitConfForkDirGet] = system(['git config --get user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); gitConf.fullForkDir = strtrim(result_gitConfForkDirGet); @@ -129,7 +132,6 @@ function initDevTools() end % define the fork directory name - gitConf.forkDirName = strrep([gitConf.leadForkDirName, gitConf.remoteRepoName], '\', '\\'); gitConf.fullForkDir = strrep([gitConf.localDir, gitConf.forkDirName], '\', '\\'); % permanently store the fork directory in the git configuration (ask the user explicitly) From cdf9dd7981ca5ec52f002b76dacb5f6ac03f3949 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 7 Jul 2017 15:50:57 +0100 Subject: [PATCH 009/163] Print out status message after git status --- src/updateFork.m | 1 + 1 file changed, 1 insertion(+) diff --git a/src/updateFork.m b/src/updateFork.m index 1fcff61..523ea83 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -157,6 +157,7 @@ function updateFork(force) error([gitCmd.lead, ' [', mfilename,'] Impossible to retrieve the features (branches) of your local fork.', gitCmd.fail]); end else + fprintf(result_gitStatus); printMsg(mfilename, ['The local fork cannot be updated as you have uncommitted changes. Please submit/publish them first.']); end From 86cc72521cde8dde25348ca1c470766c768df726 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 7 Jul 2017 16:37:17 +0100 Subject: [PATCH 010/163] Fix for updateFork --- src/initDevTools.m | 12 ++++++++++-- src/updateFork.m | 6 +++++- src/updateSubmodules.m | 28 ++++++++++++++++++---------- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index af80f91..cecee06 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -19,6 +19,10 @@ function initDevTools() gitConf.remoteRepoName = gitConf.remoteRepoURL(sepIndices(4)+1:end-4); gitConf.remoteUserName = gitConf.remoteRepoURL(sepIndices(3)+1:sepIndices(4)-1); + % ignore case for the current fork (avoids problems for untracked files with case conflicts) + [status_gitIgnoreCase, result_gitIgnoreCase] = system('git config core.ignorecase true'); + + % retrieve the user name [status_gitConfUserGet, result_gitConfUserGet] = system('git config --get user.github-username'); gitConf.userName = strtrim(result_gitConfUserGet); @@ -87,6 +91,8 @@ function initDevTools() while ~createDir reply = input([gitCmd.lead, originCall, ' -> Please define the local path to your fork\n current: ', strrep(pwd,'\','\\'),'\n Enter the path (press ENTER to use the current path): '], 's'); + reply + if isempty(reply) gitConf.localDir = strrep(pwd, '\', '\\'); else @@ -99,8 +105,10 @@ function initDevTools() end % strip the fork-nickName folder from the localDir if present - if strcmp(gitConf.localDir(end-length(gitConf.forkDirName)+1:end), gitConf.forkDirName) - gitConf.localDir = gitConf.localDir(1:end-length(gitConf.forkDirName)); + if ~isempty(gitConf.localDir) && length(gitConf.forkDirName) <= length(gitConf.localDir) + if strcmp(gitConf.localDir(end-length(gitConf.forkDirName)+1:end), gitConf.forkDirName) + gitConf.localDir = gitConf.localDir(1:end-length(gitConf.forkDirName)); + end end % warn the user of not using a fork-nickName directory or a git cloned directory as it will be cloned diff --git a/src/updateFork.m b/src/updateFork.m index 523ea83..107fb56 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -46,7 +46,7 @@ function updateFork(force) if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) % pull eventual changes from other contributors or administrators - [status_gitFetchOrigin, result_gitFetchOrigin] = system('git fetch origin '); % no pull + [status_gitFetchOrigin, result_gitFetchOrigin] = system('git fetch origin'); % no pull if status_gitFetchOrigin == 0 printMsg(mfilename, 'Changes of fork (origin) fetched.'); else @@ -78,6 +78,7 @@ function updateFork(force) fprintf(result_gitCheckout); printMsg(mfilename, ['The feature (branch) <', branches{k}, '> could not be checked out.']); end + else [status_gitCheckoutCreate, result_gitCheckoutCreate] = system(['git checkout -b ', branches{k}]); @@ -152,6 +153,9 @@ function updateFork(force) end end end + + % initialize and update the submodules + updateSubmodules(); else fprintf(resultList); error([gitCmd.lead, ' [', mfilename,'] Impossible to retrieve the features (branches) of your local fork.', gitCmd.fail]); diff --git a/src/updateSubmodules.m b/src/updateSubmodules.m index 463c166..fc47309 100644 --- a/src/updateSubmodules.m +++ b/src/updateSubmodules.m @@ -7,6 +7,11 @@ function updateSubmodules() global gitConf global gitCmd + currentDir = strrep(pwd, '\', '\\'); + + % change to the directory of the fork + cd(gitConf.fullForkDir) + % temporary disable ssl verification [status_setSSLVerify, result_setSSLVerify] = system('git config --global http.sslVerify false'); @@ -44,18 +49,18 @@ function updateSubmodules() sumChanges = sumChanges + str2num(arrResult{2*k}); end - % update the submodules - if sumChanges > 0 - % update submodules - [status_gitSubmodule, result_gitSubmodule] = system('git submodule update'); + % update submodules + [status_gitSubmodule, result_gitSubmodule] = system('git submodule update'); - if status_gitSubmodule == 0 - printMsg(mfilename, 'The submodules have been initialized.'); - else - fprintf(result_gitSubmodule); - error([gitCmd.lead, ' [', mfilename,'] The submodules could not be initialized.', gitCmd.fail]); - end + if status_gitSubmodule == 0 + printMsg(mfilename, 'The submodules have been initialized.'); + else + fprintf(result_gitSubmodule); + error([gitCmd.lead, ' [', mfilename,'] The submodules could not be initialized.', gitCmd.fail]); + end + % update the submodules + if sumChanges > 0 % reset each submodule [status_gitReset result_gitReset] = system('git submodule foreach --recursive git reset --hard'); if status_gitReset == 0 @@ -75,4 +80,7 @@ function updateSubmodules() fprintf(result_setSSLVerify); error([gitCmd.lead, ' [', mfilename,'] Your global git configuration could not be restored.', gitCmd.fail]); end + + % change back to the original directory + cd(currentDir); end From 9c2ca783a7ddd7d33d4ed30addec6272a9bde3b0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 6 Sep 2017 12:06:42 +0200 Subject: [PATCH 011/163] Fix for new CI setup Fix for home dir change of home dir Minor change debug debug (1) debug (3) debug (4) Removing output --- runtests.sh | 2 +- src/initDevTools.m | 2 -- test/inputCI.txt | 2 +- test/launchTests.m | 13 +++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/runtests.sh b/runtests.sh index 5f2dff0..a401247 100644 --- a/runtests.sh +++ b/runtests.sh @@ -1,5 +1,5 @@ #!/bin/sh cd ./test -/mnt/data/MATLAB/$MATLAB_VER/bin/./matlab -nodesktop -nosplash -r "launchTests;" < inputCI.txt; +/mnt/prince-data/MATLAB/$MATLAB_VER/bin/./matlab -nodesktop -nosplash -r "launchTests;" < inputCI.txt; CODE=$? exit $CODE diff --git a/src/initDevTools.m b/src/initDevTools.m index cecee06..bfb94d7 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -91,8 +91,6 @@ function initDevTools() while ~createDir reply = input([gitCmd.lead, originCall, ' -> Please define the local path to your fork\n current: ', strrep(pwd,'\','\\'),'\n Enter the path (press ENTER to use the current path): '], 's'); - reply - if isempty(reply) gitConf.localDir = strrep(pwd, '\', '\\'); else diff --git a/test/inputCI.txt b/test/inputCI.txt index 686e50c..b091fe7 100644 --- a/test/inputCI.txt +++ b/test/inputCI.txt @@ -1,5 +1,5 @@ cobrabot -~/ +/home/sbg-jenkins/ y n testFile1 diff --git a/test/launchTests.m b/test/launchTests.m index 0a3b884..d3e059a 100644 --- a/test/launchTests.m +++ b/test/launchTests.m @@ -1,7 +1,7 @@ if ~isempty(strfind(getenv('HOME'), 'jenkins')) % do not change the paths below - addpath(genpath('/var/lib/jenkins/MOcov')); - addpath(genpath('/var/lib/jenkins/jsonlab')); + addpath(genpath('/home/sbg-jenkins/MOcov')); + addpath(genpath('/home/sbg-jenkins/jsonlab')); % change the directory on the CI server cd([pwd, '/../']) @@ -69,11 +69,12 @@ end end - % remove the old badge - system('rm /var/lib/jenkins/userContent/codegrade-MATLABdevTools.svg'); - % set the new badge - system(['cp /var/lib/jenkins/userContent/codegrade-', grade, '.svg /var/lib/jenkins/userContent/codegrade-MATLABdevTools.svg']); + system(['cp /mnt/prince-data/jenkins/userContent/codegrade-', grade, '.svg /mnt/prince-data/jenkins/userContent/codegrade-MATLABdevTools.svg']); + + % secure copy the badge from the slave + system('scp -P 8022 /mnt/prince-data/jenkins/userContent/codegrade-MATLABdevTools.svg jenkins@prince-server.lcsb.uni.lux:/var/lib/jenkins/userContent'); + end try From 4ceeec926d5f542e8af50d04b6a6bedfbb504513 Mon Sep 17 00:00:00 2001 From: Thomas Pfau Date: Mon, 15 Jan 2018 10:10:33 +0100 Subject: [PATCH 012/163] Small Docu updates --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a907ec..8c5e93c 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,11 @@ $ git clone git@github.com:opencobra/MATLAB.devTools.git MATLAB.devTools ```` warning Run this command in `Terminal` (on macOS and Linux) or in `Git Bash` (on Windows) - **not** in Matlab. +Some issues that can arise during installation are addressed in the [FAQ](https://github.com/opencobra/MATLAB.devTools/blob/master/FAQ.md). ## Do you want to contribute to The COBRA Toolbox? -Please follow the [installation and contributing instructions](https://github.com/opencobra/cobratoolbox/blob/master/README.md). +Please follow the [installation and contributing instructions](https://github.com/opencobra/cobratoolbox/blob/master/README.rst). [![asciicast](https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy.png)](https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy) From 14d23a9f57c4818fb0a0ed3afc51d40e509fc760 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:16:06 +0100 Subject: [PATCH 013/163] remove FAQ markdown file and replace it with a rst file --- FAQ.md | 67 ----------- .../source/_static/img/logo_devTools.png | Bin docs/source/faq.rst | 106 ++++++++++++++++++ {assets => src}/confDevTools.m | 0 4 files changed, 106 insertions(+), 67 deletions(-) delete mode 100644 FAQ.md rename assets/devTools_logo.png => docs/source/_static/img/logo_devTools.png (100%) create mode 100644 docs/source/faq.rst rename {assets => src}/confDevTools.m (100%) diff --git a/FAQ.md b/FAQ.md deleted file mode 100644 index ceec67b..0000000 --- a/FAQ.md +++ /dev/null @@ -1,67 +0,0 @@ -# Frequently Asked Questions (FAQ) - -## I receive a `Permission denied` error. What can I do? - -You may encounter the following error: -``` -Permission denied (publickey) -fatal: could not read from the repository. - -Please make sure you have the correct access rights -and the repository exists. -``` - -This error can have multiple reasons, but most likely, the SSH key is not configured properly. Please follow the [configuration instructions](https://github.com/opencobra/MATLAB.devTools/blob/master/PREREQUISITES.md) carefully. - -Another source of this error may be that you have set a passphrase when generating the SSH key. Please leave the passphrase empty when generating the SSH key. - -## Mismatch of the version of `openSSL` (Linux) - -You might be in the situation that you receive the following error: -```` -OpenSSL version mismatch. Built against 1000207f, you have 100010bf -```` -In that case, you should run the following command: -```` -sudo mv /bin/glnxa64/libcrypto.so.1.0.0 /bin/glnxa64/libcrypto.so.1.0.0_bk -```` -where `` corresponds to the installation of `MATLAB`, e.g., `/usr/local/MATLAB/R2016b` - -## How do I submit a Pull Request (PR)? - -Once you submit your contribution (menu option [3]), you will be presented with a link that leads you directly to the pull request (PR). - -## Print more detailed debugging information (verbose) - -If you encounter a problem, or suspect that something is not behaving properly, please run: -```Matlab ->> contribute(1) -``` -and follow the process as normally. This will set `printLevel = 1`. You can also set permanently `gitConf.printLevel = 1;` in `assets/confDevTools.m`. - -## Resolve unexpected behavior - reset - -If you encounter unexpected behavior, please try to reset the `MATLAB.devTools` with: -```Matlab ->> resetDevTools -``` - -If you have files or changes that appear and would like to reset your local fork (without re-cloning) again, type: -```Matlab ->> resetLocalFork -``` - -## How can I abort a process? - -You can abort any process using `CTRL-C` (hit `CTRL` and `C` on your keyboard). - -## How should I name my contribution? - -Initiate a contribution per theme/topic/feature/bug fix that you work on. Don't mix features and think of an explicit name, i.e. `bug-fix-function1` or `add-tests-function2`. Avoid generic names, such as `my-great-feature` or `fix` or `contribution-myName`. - -## How can I check the history of a file? - -You can check the history of a file by typing in MATLAB: -```Matlab ->> history('fileName.m') -``` diff --git a/assets/devTools_logo.png b/docs/source/_static/img/logo_devTools.png similarity index 100% rename from assets/devTools_logo.png rename to docs/source/_static/img/logo_devTools.png diff --git a/docs/source/faq.rst b/docs/source/faq.rst new file mode 100644 index 0000000..605b3d5 --- /dev/null +++ b/docs/source/faq.rst @@ -0,0 +1,106 @@ +.. _faq: + +Frequently Asked Questions (FAQ) +================================ + +I receive a ``Permission denied`` error. What can I do? +------------------------------------------------------- + +You may encounter the following error: + +:: + + Permission denied (publickey) + fatal: could not read from the repository. + + Please make sure you have the correct access rights + and the repository exists. + +This error can have multiple reasons, but most likely, the SSH key is +not configured properly. Please follow the `configuration +instructions `__ +carefully. + +Another source of this error may be that you have set a passphrase when +generating the SSH key. Please leave the passphrase empty when +generating the SSH key. + +Mismatch of the version of ``openSSL`` (Linux) +---------------------------------------------- + +You might be in the situation that you receive the following error: + +:: + + OpenSSL version mismatch. Built against 1000207f, you have 100010bf + +In that case, you should run the following command: + +:: + + sudo mv /bin/glnxa64/libcrypto.so.1.0.0 /bin/glnxa64/libcrypto.so.1.0.0_bk + +where ```` corresponds to the installation of +``MATLAB``, e.g., ``/usr/local/MATLAB/R2016b`` + +How do I submit a Pull Request (PR)? +------------------------------------ + +Once you submit your contribution (menu option [3]), you will be +presented with a link that leads you directly to the pull request (PR). + +Print more detailed debugging information (verbose) +--------------------------------------------------- + +If you encounter a problem, or suspect that something is not behaving +properly, please run: + +.. code:: matlab + + >> contribute(1) + +and follow the process as normally. This will set ``printLevel = 1``. +You can also set permanently ``gitConf.printLevel = 1;`` in +``assets/confDevTools.m``. + +Resolve unexpected behavior - reset +----------------------------------- + +If you encounter unexpected behavior, please try to reset the +``MATLAB.devTools`` with: + +.. code:: matlab + + >> resetDevTools + +If you have files or changes that appear and would like to reset your +local fork (without re-cloning) again, type: + +.. code:: matlab + + >> resetLocalFork + +How can I abort a process? +-------------------------- + +You can abort any process using ``CTRL-C`` (hit ``CTRL`` and ``C`` on +your keyboard). + +How should I name my contribution? +---------------------------------- + +Initiate a contribution per theme/topic/feature/bug fix that you work +on. Don’t mix features and think of an explicit name, i.e. +``bug-fix-function1`` or ``add-tests-function2``. Avoid generic names, +such as ``my-great-feature`` or ``fix`` or ``contribution-myName``. + +How can I check the history of a file? +-------------------------------------- + +You can check the history of a file by typing in MATLAB: + +.. code:: matlab + + >> history('fileName.m') + + diff --git a/assets/confDevTools.m b/src/confDevTools.m similarity index 100% rename from assets/confDevTools.m rename to src/confDevTools.m From 658ab38286dea2adfcd25b56a2c59ef183d932fb Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:16:31 +0100 Subject: [PATCH 014/163] remove PREREQUISITES markdown file and replace it with a rst file --- PREREQUISITES.md | 79 -------------------- docs/source/prerequisites.rst | 133 ++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 79 deletions(-) delete mode 100644 PREREQUISITES.md create mode 100644 docs/source/prerequisites.rst diff --git a/PREREQUISITES.md b/PREREQUISITES.md deleted file mode 100644 index ac3c28d..0000000 --- a/PREREQUISITES.md +++ /dev/null @@ -1,79 +0,0 @@ -# Pre-requisites - -## GitHub SSH configuration - -You have to register the SSH key of each computer that you are planning to use the `MATLAB.devTools` on. - -- **Check if you already have an SSH key:** -```` -$ ls -al ~/.ssh -```` -If there is a file with an extension `.pub`, you already have an SSH key. Now, you have to **add your SSH key to Github**. More help is [here](https://help.github.com/articles/checking-for-existing-ssh-keys/). - -- **Generate the SSH key on your computer:** -If you don't have yet an SSH key (see previous step), you have to generate one (more help is [here](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)): -```` -$ ssh-keygen -t rsa -C "first.last@server.com" -```` -warning Leave the passphrase empty when generating the SSH key. - -- **Add the SSH** to [your Github account](https://github.com/settings/keys) by following the steps [here](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/). - -## Can I check if everything is properly set up before I start? - -Please ensure that you have a working `MATLAB` installation. - -You can check if you have a working installation of `git` by typing in the `Terminal` (on `linux` and `macOS`) or `cmd` (in `Windows`, not `Git Bash`): -```bash -$ git --version -``` -If installed properly, this will return `git version 2.13.1 [...]` or similar with another version number. - -You can then check if your `git` is properly configured by typing in the terminal (or GUI Bash): -```bash -$ git config --get user.github-username -``` -which will return your Github username if everything is properly set up. Similarly, check the configured email by typing in the terminal (or GUI Bash): -```bash -$ git config --get user.email -``` - -You can check if you have a working installation of `curl` by typing in the terminal (`cmd` on Windows, not `Git Bash`): -```bash -$ curl --version -``` -which will return `curl 7.51.0 [...]` or similar with another version number if installed properly. - -## System configuration - -You must have `git` and `curl` installed. Please also ensure that you have `MATLAB` [installed](https://nl.mathworks.com/help/install/). - -**Windows** - -Please download the `git` tools for Windows from [here](https://git-scm.com/download/win). During the installation process, please ensure that you select **Use Git Bash and optional Unix tools from the Windows Command prompt**. In addition, please make sure that you select **Checkout as-is, commit Unix-style line endings**. - -
-   . -
- -**Linux (Ubuntu or Debian)** - -```bash -$ sudo apt-get install git-all curl -``` - -**macOS** - -In order to install `git`, install the [Xcode Command Line Tools](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/). For `curl`, follow the instructions [here](http://macappstore.org/curl/). - -## Github and local `git` configuration - -If you don't have a GitHub account, please sign up [here](https://github.com/join). For the very first time, you must **fork** the repository of The COBRA Toolbox. Browse to the [original repository](https://github.com/opencobra/cobratoolbox) and click on the button -. - -On **Linux (Ubuntu)** or **macOS**, start the terminal (or any other shell). On **Windows**, start `GUI Bash`. Then type -```bash -$ git config --global user.github-username "yourGitHubUsername" -$ git config --global user.email "first.last@server.com" -``` -Please replace `"yourGitHubUsername"` and `"first.last@server.com"` with your respective credentials. diff --git a/docs/source/prerequisites.rst b/docs/source/prerequisites.rst new file mode 100644 index 0000000..f0b637c --- /dev/null +++ b/docs/source/prerequisites.rst @@ -0,0 +1,133 @@ +.. _prerequisites: + +Pre-requisites +-------------- + +GitHub SSH configuration +^^^^^^^^^^^^^^^^^^^^^^^^ + +You have to register the SSH key of each computer that you are planning +to use the ``MATLAB.devTools`` on. + +- **Check if you already have an SSH key:** + +:: + + $ ls -al ~/.ssh + +If there is a file with an extension ``.pub``, you already have an SSH +key. Now, you have to **add your SSH key to Github**. More help is +`here `__. + +- **Generate the SSH key on your computer:** If you don’t have yet an + SSH key (see previous step), you have to generate one (more help is + `here `__): + +:: + + $ ssh-keygen -t rsa -C "first.last@server.com" + + Leave the passphrase empty when generating the SSH key. + +- **Add the SSH** to `your Github + account `__ by following the steps + `here `__. + +Can I check if everything is properly set up before I start? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Please ensure that you have a working ``MATLAB`` installation. + +You can check if you have a working installation of ``git`` by typing in +the ``Terminal`` (on ``linux`` and ``macOS``) or ``cmd`` (in +``Windows``, not ``Git Bash``): + +.. code:: bash + + $ git --version + +If installed properly, this will return ``git version 2.13.1 [...]`` or +similar with another version number. + +You can then check if your ``git`` is properly configured by typing in +the terminal (or GUI Bash): + +.. code:: bash + + $ git config --get user.github-username + +which will return your Github username if everything is properly set up. +Similarly, check the configured email by typing in the terminal (or GUI +Bash): + +.. code:: bash + + $ git config --get user.email + +You can check if you have a working installation of ``curl`` by typing +in the terminal (``cmd`` on Windows, not ``Git Bash``): + +.. code:: bash + + $ curl --version + +which will return ``curl 7.51.0 [...]`` or similar with another version +number if installed properly. + +System configuration +^^^^^^^^^^^^^^^^^^^^ + +You must have ``git`` and ``curl`` installed. Please also ensure that +you have ``MATLAB`` +`installed `__. + +**Windows** + +Please download the ``git`` tools for Windows from +`here `__. During the installation +process, please ensure that you select **Use Git Bash and optional Unix +tools from the Windows Command prompt**. In addition, please make sure +that you select **Checkout as-is, commit Unix-style line endings**. + +|windows0| |windows1| + +**Linux (Ubuntu or Debian)** + +.. code:: bash + + $ sudo apt-get install git-all curl + +**macOS** + +In order to install ``git``, install the `Xcode Command Line +Tools `__. +For ``curl``, follow the instructions +`here `__. + +Github and local ``git`` configuration +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you don’t have a GitHub account, please sign up +`here `__. For the very first time, you must +**fork** the repository of The COBRA Toolbox. Browse to the `original +repository `__ and click on +the button . + +On **Linux (Ubuntu)** or **macOS**, start the terminal (or any other +shell). On **Windows**, start ``GUI Bash``. Then type + +.. code:: bash + + $ git config --global user.github-username "yourGitHubUsername" + $ git config --global user.email "first.last@server.com" + +Please replace ``"yourGitHubUsername"`` and ``"first.last@server.com"`` +with your respective credentials. + +.. |windows0| image:: https://prince.lcsb.uni.lu/img/installation_git_windows_0.png + :width: 280px + +.. |windows1| image:: https://prince.lcsb.uni.lu/img/installation_git_windows_1.png + :width: 280px + + From 6ddc7632b4ee2ddda75eae2dcb582cff17c8bd82 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:18:43 +0100 Subject: [PATCH 015/163] update gitignore --- .gitignore | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fafff2e..b06cffd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,39 @@ +build +*.*~ .DS_Store -Thumbs.db +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows shortcuts +*.lnk + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Documentation related files +docs/source/_static/json/functions.json From bf76aabceb776b511d998667bcb1cdb90c4a52e7 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:20:07 +0100 Subject: [PATCH 016/163] add configuration files --- docs/Makefile | 228 ++++++++++++++++++++++++++ docs/source/conf.py | 388 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 616 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/source/conf.py diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..489d6fd --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,228 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " epub3 to make an epub3" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + @echo " dummy to check syntax errors of document sources" + +.PHONY: clean +clean: + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + @echo "Generating list of suggestions for the websearch." + python generateJSONList.py + @echo + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MWE.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MWE.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/MWE" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MWE" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: epub3 +epub3: + $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 + @echo + @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +.PHONY: dummy +dummy: + $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy + @echo + @echo "Build finished. Dummy builder generates no files." diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..4037591 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,388 @@ +# -*- coding: utf-8 -*- +# +# Documentation build configuration file, created by +# sphinx-quickstart on Fri Nov 18 11:12:41 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. + +import os +import sys + +sys.path.append('sphinxext') +from github_linkcode import github_linkcode_resolve + + +sys.path.insert(0, os.path.abspath(os.path.join('..', '..', '..'))) +# sys.path.insert(0, os.path.abspath('.')) + +# tell Sphinx matlab extension where to find matlab code. +matlab_src_dir = os.path.abspath(os.path.join('..', '..')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinxcontrib.napoleon', + 'sphinxcontrib.matlab', + 'github', + 'sphinx.ext.mathjax', + 'sphinx.ext.linkcode', + 'sphinxcontrib.fulltoc'] + +mathjax_path = 'https://cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML' + +def linkcode_resolve(domain, info): + return github_linkcode_resolve( + domain=domain, + info=info, + allowed_module_names=['src'], + github_org_id='opencobra', + github_repo_id='MATLAB.devTools', + branch='master', + source_prefix='') + + +# autodoc_member_order='groupwise' +primary_domain = 'mat' + +# remove path in function names +add_module_names = False + +# Add any paths that contain templates here, relative to this directory. +# templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = ['.rst'] + +# The encoding of source files. +# +source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'contents' + +# General information about the project. +project = u'MATLAB.devTools' +copyright = u'2017-2018, the MATLAB.devTools developers' +author = u'The MATLAB.devTools developers' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'0.1' +# The full version, including alpha/beta/rc tags. +release = u'0.1.1' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None +conf_py_path = os.getcwd() +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# +# today = '' +# +# Else, today_fmt is used as the format for a strftime call. +# +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +html_theme = "sphinx_julia_theme" + +import sphinx_julia_theme +import sphinx_rtd_theme + +html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), + sphinx_julia_theme.get_theme_dir()] +print html_theme_path +html_sidebars = sphinx_julia_theme.default_sidebars() + +# shutil.copy() + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = {'display_version': False} + +html_context = {'conf_py_path': os.path.join(os.sep, 'docs', 'source', ''), + 'github_user': 'opencobra', + 'github_repo': 'MATLAB.devTools', + 'github_version': 'master', + 'logo': 'img/logo_devTools.png', + 'theme_logo_only': True, + 'show_source': False} +# 'display_github': True} +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. +# " v documentation" by default. +# +html_title = u'MATLAB.devTools' + +# A shorter title for the navigation bar. Default is the same as html_title. +# +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# +html_logo = '_static/img/logo_devTools.png' + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# +html_favicon = '_static/img/logo_devTools.ico' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# +# html_extra_path = [] + +# If not None, a 'Last updated on:' timestamp is inserted at every page +# bottom, using the given strftime format. +# The empty string is equivalent to '%b %d, %Y'. +# +# html_last_updated_fmt = None + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# +# html_sidebars = {'index': 'indexsidebar.html'} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# +# html_index = 'index.html' +# html_additional_pages = {'index': 'index.html'} + +# If false, no module index is generated. +# +# html_domain_indices = True + +# If false, no index is generated. +# +# html_use_index = False + +# If true, the index is split into individual pages for each letter. +# +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' +# +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# 'ja' uses this config value. +# 'zh' user can custom change `jieba` dictionary path. +# +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'MATLAB.devToolsDoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'MATLAB.devTools.tex', u'The MATLAB.devTools Documentation', + u'The MATLAB.devTools developers', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# +# latex_use_parts = False + +# If true, show page references after internal links. +# +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# +# latex_appendices = [] + +# It false, will not define \strong, \code, itleref, \crossref ... but only +# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added +# packages. +# +# latex_keep_old_macro_names = True + +# If false, no module index is generated. +# +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'MATLAB.devTools', u'The MATLAB.devTools Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +# +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'MATLAB.devTools', u'The MATLAB.devTools Documentation', + author, 'MATLAB.devTools', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +# +# texinfo_appendices = [] + +# If false, no module index is generated. +# +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# +# texinfo_no_detailmenu = False From 14b16c13835cdb4e5dd0ddc32c6dc740a8e51bc5 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:21:41 +0100 Subject: [PATCH 017/163] add the link code extension --- .gitignore | 1 + docs/source/sphinxext/__init__.py | 0 docs/source/sphinxext/github_linkcode.py | 243 +++++++++++++++++++++++ 3 files changed, 244 insertions(+) create mode 100644 docs/source/sphinxext/__init__.py create mode 100644 docs/source/sphinxext/github_linkcode.py diff --git a/.gitignore b/.gitignore index b06cffd..1ee3278 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Temporary Items # Documentation related files docs/source/_static/json/functions.json +*.pyc diff --git a/docs/source/sphinxext/__init__.py b/docs/source/sphinxext/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/docs/source/sphinxext/github_linkcode.py b/docs/source/sphinxext/github_linkcode.py new file mode 100644 index 0000000..dfe9e61 --- /dev/null +++ b/docs/source/sphinxext/github_linkcode.py @@ -0,0 +1,243 @@ +"""Sphinx extension to link to source code on GitHub. + +This links to source code for modules, classes, etc. to the correct line on +GitHub. This prevents having to bundle the source code along with the +documentation, and better ties everything together. + + +Setup +===== + +To use this, you'll need to import the module and define your own +:py:func:`linkcode_resolve` in your :file:`conf.py`:: + + from beanbag_docutils.sphinx.ext.github import github_linkcode_resolve + + extensions = [ + ... + 'sphinx.ext.linkcode', + ... + ] + + def linkcode_resolve(domain, info): + return github_linkcode_resolve( + domain=domain, + info=info, + allowed_module_names=['mymodule'], + github_org_id='myorg', + github_repo_id='myrepo', + branch='master', + source_prefix='src/') + +``source_prefix`` and ``allowed_module_names`` are optional. See the +docs for :py:func:`github_linkcode_resolve` for more information. +""" + +from __future__ import unicode_literals + +import inspect +import re +import subprocess +import sys + + +GIT_BRANCH_CONTAINS_RE = re.compile(r'^\s*([^\s]+)\s+([0-9a-f]+)\s.*') + + +_head_ref = None + + +def _run_git(cmd): + """Run git with the given arguments, returning the output. + + Args: + cmd (list of unicode): + A list of arguments to pass to :command:`git`. + + Returns: + str: + The resulting output from the command. + + Raises: + subprocess.CalledProcessError: + Error calling into git. + """ + p = subprocess.Popen(['git'] + cmd, stdout=subprocess.PIPE) + output, error = p.communicate() + ret_code = p.poll() + + if ret_code: + raise subprocess.CalledProcessError(ret_code, 'git') + + return output + + +def _git_get_nearest_tracking_branch(merge_base, remote='origin'): + """Return the nearest tracking branch for the given Git repository. + + Args: + merge_base (unicode): + The merge base used to locate the nearest tracking branch. + + remote (origin, optional): + The remote name. + + Returns: + unicode: + The nearest tracking branch, or ``None`` if not found. + """ + try: + _run_git(['fetch', 'origin', '%s:%s' % (merge_base, merge_base)]) + except Exception: + # Ignore, as we may already have this. Hopefully it won't fail later. + pass + + lines = _run_git(['branch', '-rv', '--contains', merge_base]).splitlines() + + remote_prefix = '%s/' % remote + best_distance = None + best_ref_name = None + + for line in lines: + m = GIT_BRANCH_CONTAINS_RE.match(line.strip()) + + if m: + ref_name = m.group(1) + sha = m.group(2) + + if (ref_name.startswith(remote_prefix) and + not ref_name.endswith('/HEAD')): + + distance = len(_run_git(['log', + '--pretty=format:%%H', + '...%s' % sha]).splitlines()) + + if best_distance is None or distance < best_distance: + best_distance = distance + best_ref_name = ref_name + + if best_ref_name and best_ref_name.startswith(remote_prefix): + # Strip away the remote. + best_ref_name = best_ref_name[len(remote_prefix):] + + return best_ref_name + + +def _get_git_doc_ref(branch): + """Return the commit SHA used for linking to source code on GitHub. + + The commit SHA will be cached for future lookups. + + Args: + branch (unicode): + The branch to use as a merge base. + + Returns: + unicode: + The commit SHA used for any links, if found, or ``None`` if not. + """ + global _head_ref + + if not _head_ref: + try: + tracking_branch = _git_get_nearest_tracking_branch(branch) + _head_ref = _run_git(['rev-parse', tracking_branch]).strip() + except subprocess.CalledProcessError: + _head_ref = None + + return _head_ref + + +def github_linkcode_resolve(domain, info, github_org_id, github_repo_id, + branch, source_prefix='', allowed_module_names=[]): + """Return a link to the source on GitHub for the given autodoc info. + + This takes some basic information on the GitHub project, branch, and + what modules are considered acceptable, and generates a link to the + approprite line on the GitHub repository browser for the class, function, + variable, or other object. + + Args: + domain (unicode): + The autodoc domain being processed. This only accepts "py", and + comes from the original :py:func:`linkcode_resolve` call. + + info (dict): + Information on the item being linked to. This comes from the + original :py:func:`linkcode_resolve` call. + + github_org_id (unicode): + The GitHub organization ID. + + github_repo_id (unicode): + The GitHub repository ID. + + branch (unicode): + The branch used as a merge base to find the appropriate commit + to link to. Callers may want to compute this off of the version + number of the project, or some other information. + + source_prefix (unicode, optional): + A prefix for any linked filename, in case the module is not at + the top of the source tree. + + allowed_module_names (list of unicode, optional): + The list of top-level module names considered valid for links. + If provided, links will only be generated if residing somewhere + in one of the provided module names. + """ + module_name = info['module'] + + # print domain != 'mat' + # print not module_name + # print module_name.split('.')[0] + # print allowed_module_names + # print (allowed_module_names and + # module_name.split('.')[0] not in allowed_module_names) + if (domain != 'mat' or + not module_name or + (allowed_module_names and + module_name.split('.')[0] not in allowed_module_names)): + # These aren't the modules you're looking for. + return None + + # Grab the name of the source file. + filename = module_name.replace('.', '/') + '/' + info['fullname'] + '.m' + + # Grab the module referenced in the docs. + submod = sys.modules.get(module_name) + + if submod is None: + return None + + # Split that, trying to find the module at the very tail of the module + # path. + obj = submod + + for part in info['fullname'].split('.'): + try: + obj = getattr(obj, part) + except: + return None + + # Find the line number of the thing being documented. + try: + linenum = inspect.findsource(obj)[1] + except: + linenum = None + + # Build a reference for the line number in GitHub. + if linenum: + linespec = '#L%d' % (linenum + 1) + else: + linespec = '' + + # Get the branch/tag/commit to link to. + ref = _get_git_doc_ref(branch) or branch + # print "branch: ", branch + # print ('https://github.com/%s/%s/blob/%s/%s%s%s' + # % (github_org_id, github_repo_id, ref, source_prefix, + # filename, linespec)) + return ('https://github.com/%s/%s/blob/%s/%s%s%s' + % (github_org_id, github_repo_id, ref, source_prefix, + filename, linespec)) From c9b4ace2dbcb0cf25db42f9dd3bad0be59f59023 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:22:21 +0100 Subject: [PATCH 018/163] add content and index files --- README.rst | 143 +++++++++++++++++++++++++++++++++++++++ docs/source/contents.rst | 13 ++++ docs/source/index.rst | 28 ++++++++ 3 files changed, 184 insertions(+) create mode 100644 README.rst create mode 100644 docs/source/contents.rst create mode 100644 docs/source/index.rst diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..1b5a3dc --- /dev/null +++ b/README.rst @@ -0,0 +1,143 @@ +.. raw:: html + +

+ +

+ +

+ MATLAB.devTools - Contribute the smart way +

+ ++----------------+----------------+---------------+--------------+ +| MATLAB R2016b | MATLAB R2015b | Code Coverage | Code Grade | ++================+================+===============+==============+ +| |Build Status| | |Build Status| | |codecov| | |Code grade| | ++----------------+----------------+---------------+--------------+ + + +Pre-requisites +-------------- + +.. begin-prerequisites-marker + +Please follow the `configuration +instructions `__ +carefully. You may skip this if your system is already set up and you +have ``git`` configured. + + **IMPORTANT**: Please make sure that you have configured your SSH key +in Github as explained +`here `__. + +.. end-prerequisites-marker + +Installation +------------ + +.. begin-installation-marker + +Download this repository (the folder ``./MATLAB.devTools/`` will be +created). You can clone the repository using: + +.. code:: bash + + $ git clone git@github.com:opencobra/MATLAB.devTools.git MATLAB.devTools + + Run this command in ``Terminal`` (on and ) or in ``Git Bash`` (on ) - +**not** in . + +Some issues that can arise during installation are addressed in the +`FAQ `__. + +.. end-installation-marker + +Do you want to contribute to The COBRA Toolbox? +----------------------------------------------- + +Please follow the `installation and contributing +instructions `__. + +|asciicast| + +How do I use the ``MATLAB.devTools``? +------------------------------------- + +.. begin-getstarted-marker + +Making a contribution to any ``git`` repository from is straightforward. +Type in within the ``MATLAB.devTools`` folder: + +.. code:: matlab + + >> contribute + +You will then be presented by a menu: + +:: + + [1] Start a new feature (branch). + [2] Select an existing feature (branch) to work on. + [3] Publish a feature (branch). + [4] Delete a feature (branch). + [5] Update the fork. + + -> Please select what you want to do (enter the number): + +The original repository will be downloaded (cloned) the first time to a +folder named ``fork-gitRepoName``. **Only files in the +``fork-gitRepoName`` folder** will be considered for contribution (any +changes made to a downloaded official ``git`` repository will be +ignored). + + If you get stuck or are faced with an system error message, please read +the +`FAQ `__. + +.. end-getstarted-marker + +How can I update my fork without contributing? +---------------------------------------------- + +In order to only update your fork, run ``>> contribute`` and select menu +item ``[5]``. + +Configure the ``MATLAB.devTools`` for another repository +-------------------------------------------------------- + + The ``MATLAB.devTools`` can only be used with **publicly accessible** +repositories. + +If you want to use the ``MATLAB.devTools`` with a repository other than +the default repository, you must set the following variables: + +.. code:: matlab + + launcher = '\n\n ~~~ MATLAB.devTools ~~~\n\n'; % a message for the repository (any string) + remoteRepoURL = 'https://server.com/repositoryName.git'; % the remote url + nickName = 'repoNickName'; % a nickName of the repository (any string) + printLevel = 0; % set the printLevel mode + +and run: + +.. code:: matlab + + >> confDevTools(launcher, remoteRepoURL, nickName, printLevel); % sets the configuration + +In order to reset the configuration, type: + +.. code:: matlab + + >> resetDevTools(); + +If you want your changes to be permanent, you can set the above +mentioned variables in ``./assets/confDevTools.m``. + +.. |Build Status| image:: https://prince.lcsb.uni.lu/jenkins/buildStatus/icon?job=devTools-branches-auto/MATLAB_VER=R2016b + :target: https://prince.lcsb.uni.lu/jenkins/job/devTools-branches-auto/MATLAB_VER=R2016b/ +.. |Build Status| image:: https://prince.lcsb.uni.lu/jenkins/buildStatus/icon?job=devTools-branches-auto/MATLAB_VER=R2015b + :target: https://prince.lcsb.uni.lu/jenkins/job/devTools-branches-auto/MATLAB_VER=R2015b/ +.. |codecov| image:: https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master/graph/badge.svg + :target: https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master +.. |Code grade| image:: https://prince.lcsb.uni.lu/jenkins/userContent/codegrade-MATLABdevTools.svg?maxAge=0 +.. |asciicast| image:: https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy.png + :target: https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy diff --git a/docs/source/contents.rst b/docs/source/contents.rst new file mode 100644 index 0000000..52e882e --- /dev/null +++ b/docs/source/contents.rst @@ -0,0 +1,13 @@ +MATLAB.devTools +=============== + +.. toctree:: + :maxdepth: 2 + + index + installation + getstarted + modules/index + support + faq + funding diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..029aa23 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,28 @@ +.. _index: + +.. image:: _static/img/logo_devTools.png + :align: center + :width: 160px + +MATLAB.devTools +=============== + +.. rst-class:: under-title + +MATLAB.devTools - Contribute the smart way + +.. raw:: html + + + +
+ View MATLAB.devTools source code on . +
+ + +.. include:: ../../README.rst + :start-after: begin-intro-marker + :end-before: end-intro-marker + From d54b04bfcccbee8c8264397db89568ddde5fe775 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:23:35 +0100 Subject: [PATCH 019/163] add funding page --- docs/source/funding.rst | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/source/funding.rst diff --git a/docs/source/funding.rst b/docs/source/funding.rst new file mode 100644 index 0000000..3449415 --- /dev/null +++ b/docs/source/funding.rst @@ -0,0 +1,58 @@ +Funding +======= + +.. raw:: html + + +
+ + + + + + +
+
+
+
+
+ National Centre of Excellence in Research (NCER) on Parkinson’s disease. +
+ + + + + + +
+
+
+ U.S. Department of Energy, Offices of Advanced Scientific Computing Research and the Biological and Environmental Research as part of the Scientific Discovery Through Advanced Computing program, grant no. DE-SC0010429 +
+ +
+

+

+ Fonds National de la Recherche grant O16/11402054 and the Luxembourg National Research Fund (FNR) ATTRACT program grant (FNR/A12/01). +
+

+ +

From b287c3698001e425cd1b28001edffd4fb1a21672 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:24:02 +0100 Subject: [PATCH 020/163] add get started page and installation --- docs/source/getstarted.rst | 7 +++++++ docs/source/installation.rst | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 docs/source/getstarted.rst create mode 100644 docs/source/installation.rst diff --git a/docs/source/getstarted.rst b/docs/source/getstarted.rst new file mode 100644 index 0000000..417d806 --- /dev/null +++ b/docs/source/getstarted.rst @@ -0,0 +1,7 @@ +How to get started +================== + +.. include:: ../../README.rst + :start-after: begin-getstarted-marker + :end-before: end-getstarted-marker + diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 0000000..96bdb11 --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,15 @@ +.. _installation: + +Installation +============ + +.. include:: prerequisites.rst + + +Installation +------------ + +.. include:: ../../README.rst + :start-after: begin-installation-marker + :end-before: end-installation-marker + From a76408f254c9d880d1b384dd536965e57d8ede08 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:24:45 +0100 Subject: [PATCH 021/163] add autodoc directives for matlab functions --- docs/generateJSONList.py | 43 +++++++++++++++++++++++++++++++++++ docs/source/modules/index.rst | 8 +++++++ 2 files changed, 51 insertions(+) create mode 100644 docs/generateJSONList.py create mode 100644 docs/source/modules/index.rst diff --git a/docs/generateJSONList.py b/docs/generateJSONList.py new file mode 100644 index 0000000..20bb0a7 --- /dev/null +++ b/docs/generateJSONList.py @@ -0,0 +1,43 @@ +import os +import json +import errno + +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise + + +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise + +def path_to_list(path): + d = [] + path_length = len(path) + for root, directories, filenames in os.walk(path): + for filename in filenames: + print os.path.join('source', 'modules', root[path_length+1:], 'index.rst') + if filename[-2:] == '.m' and os.path.isfile(os.path.join('source', 'modules', root[path_length+1:], 'index.rst')): + website_url = os.path.join("modules", root[path_length+1:], "index.html") + website_url += "?highlight=" + filename[:-2] + website_url += "#" + '.'.join(['src'] + root[path_length+1:].split(os.path.sep) + [filename[:-2]]) + d.append({'name': filename[:-2], + 'website_url': website_url}) + print root, filename + return d + +destination_dir = os.path.join('source', '_static', 'json') +mkdir_p(destination_dir) +with open(os.path.join(destination_dir, 'functions.json'), 'w') as f: + d = path_to_list('../src/.') + json.dump(d, f) diff --git a/docs/source/modules/index.rst b/docs/source/modules/index.rst new file mode 100644 index 0000000..d475b7b --- /dev/null +++ b/docs/source/modules/index.rst @@ -0,0 +1,8 @@ +.. _modules_functions: + +Functions +--------- + +.. automodule:: src + :members: + From 62c2a5583853d4d77d24eee5912ecf9ec92cc317 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:25:46 +0100 Subject: [PATCH 022/163] add requirement file --- docs/requirements.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..175c844 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,6 @@ +git+https://github.com/uni-lu/sphinx.git@develop#egg=sphinx +git+https://github.com/syarra/sphinxcontrib-matlabdomain#egg=sphinxcontrib-matlabdomain +sphinx_rtd_theme +git+https://github.com/uni-lu/sphinx_julia_theme.git@develop#egg=sphinx_julia_theme +git+https://github.com/syarra/Documenter.py@develop#egg=documenter +git+https://github.com/uni-lu/sphinxcontrib-napoleon.git@develop#egg=sphinxcontrib_napoleon From 8eac2be58d37702b7129ee24080b330874db6899 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:27:23 +0100 Subject: [PATCH 023/163] renamed CI file --- .travis.yml => .artenolis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .travis.yml => .artenolis.yml (100%) diff --git a/.travis.yml b/.artenolis.yml similarity index 100% rename from .travis.yml rename to .artenolis.yml From 05615dce37571bc64762e94dd7607484a74dc3d5 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:28:23 +0100 Subject: [PATCH 024/163] move runtest to the .artenolis folder --- runtests.sh => .artenolis/runtests.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename runtests.sh => .artenolis/runtests.sh (100%) diff --git a/runtests.sh b/.artenolis/runtests.sh similarity index 100% rename from runtests.sh rename to .artenolis/runtests.sh From aea7e71f01216deddfe420906de2785af4499bf0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:29:10 +0100 Subject: [PATCH 025/163] Documentation for checkBranchExistence --- src/checkBranchExistence.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/checkBranchExistence.m b/src/checkBranchExistence.m index f779b7e..fbb53f4 100644 --- a/src/checkBranchExistence.m +++ b/src/checkBranchExistence.m @@ -1,8 +1,18 @@ function branchExists = checkBranchExistence(branchName) -% devTools +% Checks if a branch exists locally % -% PURPOSE: checks if a branch exists locally +% USAGE: % +% branchExists = checkBranchExistence(branchName) +% +% INPUT: +% branchName: Name of the local branch to be checked for existence +% +% OUTPUT: +% branchExists: Boolean (true if `branchName` esists) +% +% .. Author: +% - Laurent Heirendt global gitConf From a9969585c306d90f7af7473cd458580b0da0b86e Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:29:29 +0100 Subject: [PATCH 026/163] update .artenolis for runtest move --- .artenolis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.artenolis.yml b/.artenolis.yml index 74f4b2a..60e11cf 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -48,7 +48,7 @@ script: - cd $CURRENT_DIR; # launch the tests - - sh ./runtests.sh; + - sh ./.artenolis/runtests.sh; - cd ~/fork-MATLAB.devTools.CI; - git reset --hard origin/develop; From a53158c8d6105eeefa97231c7d7cf64617766c9d Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 17:32:07 +0100 Subject: [PATCH 027/163] add documentation build instructions in the yml file --- .artenolis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.artenolis.yml b/.artenolis.yml index 60e11cf..79f9dc4 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -58,4 +58,7 @@ after_success: # remove the cloned fork-repo - if [ "$MATLAB_VER" == "R2016b" ]; then bash <(curl -s https://codecov.io/bash) -f "!*.lst"; + export PATH="/home/sbg-jenkins/.local/bin":$PATH; + pip install --upgrade --user -r docs/requirements.txt; + python -c "from documenter.deploy import Documentation; doc = Documentation('github.com/opencobra/MATLAB.devTools', ci='jenkins'); doc.deploy()"; fi From f79888f2f21fe6a1fa730b90ba73abbf8a6e7c42 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:33:42 +0100 Subject: [PATCH 028/163] Documentation for checkDevTools --- src/checkDevTools.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/checkDevTools.m b/src/checkDevTools.m index c7ac627..a261507 100644 --- a/src/checkDevTools.m +++ b/src/checkDevTools.m @@ -1,8 +1,12 @@ -function checkDevTools() -% devTools +function [] = checkDevTools() +% Checks the configuration of the development tools % -% PURPOSE: checks the configuration of the development tools +% USAGE: % +% [] = checkDevTools() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From e3ecad5ee62ca9e53d0f64e70819c15dee09a511 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:35:47 +0100 Subject: [PATCH 029/163] Documentation for checkLocalFork --- src/checkLocalFork.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/checkLocalFork.m b/src/checkLocalFork.m index caa2cbe..2fe140a 100644 --- a/src/checkLocalFork.m +++ b/src/checkLocalFork.m @@ -1,8 +1,13 @@ -function checkLocalFork() -% devTools +function [] = checkLocalFork() +% Checks the configuration of remotes in the local copy of the fork % -% PURPOSE: checks the configuration of remotes in the local copy of the fork +% USAGE: % +% [] = checkLocalFork() +% +% .. Author: +% - Laurent Heirendt + global gitConf global gitCmd From 6a0465a549aa1e5505f3c68607446f2511002a9d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:38:26 +0100 Subject: [PATCH 030/163] Documentation for checkRemoteFork --- src/checkRemoteFork.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/checkRemoteFork.m b/src/checkRemoteFork.m index 6f33c4a..ad373db 100644 --- a/src/checkRemoteFork.m +++ b/src/checkRemoteFork.m @@ -1,8 +1,14 @@ -function checkRemoteFork() -% devTools +function [] = checkRemoteFork() +% Checks whether the fork exists remotely % -% PURPOSE: checks whether the fork exists remotely +% USAGE: % +% [] = checkRemoteFork() +% +% .. Author: +% - Laurent Heirendt + + global gitConf global gitCmd From fdb43b17e71f8bd5ab8c3b899de6097eb95208c4 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:40:31 +0100 Subject: [PATCH 031/163] Documentation for checkStatus --- src/checkStatus.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/checkStatus.m b/src/checkStatus.m index 36592c0..790ba20 100644 --- a/src/checkStatus.m +++ b/src/checkStatus.m @@ -1,8 +1,12 @@ -function checkStatus() -% devTools +function [] = checkStatus() +% Checks the status of the repository % -% PURPOSE: checks the status of the repository +% USAGE: % +% [] = checkStatus() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From a0d82be8079de7edebf544a7cfc487189c51d3e5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:46:00 +0100 Subject: [PATCH 032/163] Documentation for checkSystem --- src/checkSystem.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 6f0585f..ef244e6 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -1,8 +1,16 @@ -function checkSystem(callerName) -% devTools +function [] = checkSystem(callerName) +% Checks the configuration of the system (installation of git and curl) % -% PURPOSE: checks the configuration of the system (installation of git and curl) +% USAGE: % +% [] = checkSystem(callerName) +% +% INPUT: +% callerName: Name of the function calling `checkSystem()` +% +% .. Author: +% - Laurent Heirendt + global gitConf global gitCmd From 82a6f484bd2dec47bbf634bf67bf39e3474fabef Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 17:58:36 +0100 Subject: [PATCH 033/163] Documentation for checkoutBranch --- src/checkoutBranch.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 808c674..7ef2055 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -1,14 +1,22 @@ -function checkoutBranch(branchName, update_fork) -% devTools +function [] = checkoutBranch(branchName, updateForkFlag) +% checks out a branch named locally and remotely % -% PURPOSE: checks out a branch named locally and remotely +% USAGE: % +% [] = checkoutBranch(branchName, updateForkFlag) +% +% INPUT: +% branchName: Name of the local branch to be checked out +% updateForkFlag: Boolean to update the fork before checking out the branch +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd if nargin < 2 - update_fork = true; + updateForkFlag = true; end % save the currentDir @@ -36,7 +44,7 @@ function checkoutBranch(branchName, update_fork) printMsg(mfilename, ['The current feature (branch) ', currentBranch, ' is not the feature (branch).'], [gitCmd.fail, gitCmd.trail]); % update the fork locally - if update_fork + if updateForkFlag updateFork(true); end @@ -87,7 +95,7 @@ function checkoutBranch(branchName, update_fork) % retrieve the status [status_gitStatus, result_gitStatus] = system('git status -s'); - if (status_gitStatus == 0 && isempty(result_gitStatus)) || ~update_fork + if (status_gitStatus == 0 && isempty(result_gitStatus)) || ~updateForkFlag % properly checkout the branch [status_gitCheckout, result_gitCheckout] = system(['git checkout ', checkoutFlag, ' ', branchName]); From 16cb48a952f6190964fb2295981906f7a8a69b6d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:00:56 +0100 Subject: [PATCH 034/163] Documentation for cloneFork --- src/cloneFork.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cloneFork.m b/src/cloneFork.m index 4f5cda0..4aabb41 100644 --- a/src/cloneFork.m +++ b/src/cloneFork.m @@ -1,8 +1,16 @@ function freshClone = cloneFork() -% devTools +% Clones the fork and updates the submodules of the repository % -% PURPOSE: clones the fork and updates the submodules of the repository +% USAGE: % +% freshClone = cloneFork() +% +% OUTPUT: +% freshClone: Boolean (true if a new clone has been made) +% +% .. Author: +% - Laurent Heirendt + global gitConf global gitCmd From 1adb702ea728d7ca7d847b851d1b2703ec900263 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:02:44 +0100 Subject: [PATCH 035/163] Documentation for configureFork --- src/configureFork.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/configureFork.m b/src/configureFork.m index 3eae67b..f282ad1 100644 --- a/src/configureFork.m +++ b/src/configureFork.m @@ -1,8 +1,12 @@ -function configureFork() -% devTools +function [] = configureFork() +% Configures the remotes of the local fork (upstream) % -% PURPOSE: configures the remotes of the local fork (upstream) +% USAGE: % +% [] = configureFork() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 4d8fae72d657a58a31bfa40a5972215ac11f7c74 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:04:27 +0100 Subject: [PATCH 036/163] Documentation for deleteContribution --- src/deleteContribution.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/deleteContribution.m b/src/deleteContribution.m index cca205a..b7e2961 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -1,8 +1,15 @@ -function deleteContribution(branchName) -% devTools +function [] = deleteContribution(branchName) +% Deletes and existing feature (branch) named % -% PURPOSE: deletes and existing feature (branch) named +% USAGE: % +% [] = deleteContribution(branchName) +% +% INPUT: +% branchName: Name of the local branch to be deleted +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 95192d23a32bbfbeb7a9e50dff7edc445ad87e69 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:06:06 +0100 Subject: [PATCH 037/163] Documentation for getCurrentBranchName --- src/getCurrentBranchName.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/getCurrentBranchName.m b/src/getCurrentBranchName.m index a0f5bf0..76f687e 100644 --- a/src/getCurrentBranchName.m +++ b/src/getCurrentBranchName.m @@ -1,8 +1,17 @@ function currentBranch = getCurrentBranchName() -% devTools +% Retrieve the name of the current branch % -% PURPOSE: retrieve the name of the current branch +% USAGE: % +% currentBranch = getCurrentBranchName() +% +% OUTPUT: +% currentBranch: Name of the current branch +% +% .. Author: +% - Laurent Heirendt + + global gitConf global gitCmd From 6eba1ed7e0d0c3bb69a87fbe99be3842482cba2e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:07:43 +0100 Subject: [PATCH 038/163] Documentation for history --- src/history.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/history.m b/src/history.m index 4cbc936..4b91289 100644 --- a/src/history.m +++ b/src/history.m @@ -1,8 +1,17 @@ -function history(fileName) -% devTools +function [] = history(fileName) +% Displays the history of a file % -% PURPOSE: displays the history of a file +% USAGE: % +% [] = history(fileName) +% +% INPUT: +% fileName: Name of the file for which the history shall be displayed +% +% .. Author: +% - Laurent Heirendt + + global gitConf fullPath = which(fileName); From a75d6470657b6ee87f0bcd077827071d58bc8b0a Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:12:42 +0100 Subject: [PATCH 039/163] Documentation for initContribution --- src/initContribution.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/initContribution.m b/src/initContribution.m index d47c5dc..355dc64 100644 --- a/src/initContribution.m +++ b/src/initContribution.m @@ -1,8 +1,15 @@ -function initContribution(branchName) -% devTools +function [] = initContribution(branchName) +% Initializes a new feature (branch) named `branchName` % -% PURPOSE: initializes a new feature (branch) named +% USAGE: % +% [] = initContribution(branchName) +% +% INPUT: +% branchName: Name of the local branch to be initialized +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From df77e2fe20089d8b40527679e463efd436aea531 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:13:46 +0100 Subject: [PATCH 040/163] Documentation for initDevTools --- src/initDevTools.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index bfb94d7..98349b2 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -1,8 +1,14 @@ -function initDevTools() -% devTools +function [] = initDevTools() +% Initializes the development tools (username and email are requested if not configured) % -% PURPOSE: initializes the development tools (username and email are requested if not configured) +% USAGE: % +% [] = initDevTools() +% +% .. Author: +% - Laurent Heirendt + + global gitConf global gitCmd From 623089cb6a048eded2292140b9bd27c05d243add Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:19:20 +0100 Subject: [PATCH 041/163] Documentation for listFeatures --- src/listFeatures.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/listFeatures.m b/src/listFeatures.m index 64b1a85..c7c9448 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -1,8 +1,20 @@ function [exitFlag, currentBranch, arrResult, exampleBranch] = listFeatures() -% devTools +% Lists all available branches/features % -% PURPOSE: lists all available branches/features +% USAGE: % +% [exitFlag, currentBranch, arrResult, exampleBranch] = listFeatures() +% +% OUTPUT: +% exitFlag: Boolean (true if proper exit of function) +% currentBranch: Name of current branch +% arrResult: Cell with all names of branches +% exampleBranch: Name of a branch given as an example +% +% .. Author: +% - Laurent Heirendt + + global gitConf From 1c0d43cd102080561ab42eaf22c9239140e1d9c6 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:21:08 +0100 Subject: [PATCH 042/163] Documentation for openPR --- src/openPR.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/openPR.m b/src/openPR.m index ef01d36..94f5bac 100644 --- a/src/openPR.m +++ b/src/openPR.m @@ -1,8 +1,15 @@ -function openPR(branchName) -% devTools +function [] = openPR(branchName) +% Provides a pull request URL from to on the upstream % -% PURPOSE: provides a pull request URL from to on the upstream +% USAGE: % +% [] = openPR(branchName) +% +% INPUT: +% branchName: Name of the branch for which a pull request (PR) shall be opened +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 68cdf048d52a22050a6ea12caae0845d85c707e1 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:23:27 +0100 Subject: [PATCH 043/163] Documentation for printMsg --- src/printMsg.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/printMsg.m b/src/printMsg.m index 1c58400..0c445c2 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -1,8 +1,16 @@ -function printMsg(fileName, msg, endMsg) -% devTools +function [] = printMsg(fileName, msg, endMsg) +% Print a message % -% PURPOSE: print a message +% USAGE: % +% [] = printMsg(fileName, msg, endMsg) +% +% INPUT: +% fileName: Name of the file from which the message is issued +% msg: Message as string +% endMsg: End of message, generally a new line character +% +% .. Author: global gitConf global gitCmd From d9168e8e198c277259ae696c92e0ce0d47c25329 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:24:25 +0100 Subject: [PATCH 044/163] Documentation for resetDevTools --- src/resetDevTools.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/resetDevTools.m b/src/resetDevTools.m index cffa144..94bd6f3 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -1,8 +1,12 @@ -function resetDevTools() -% devTools +function [] = resetDevTools() +% Reset the configuration of the development tools % -% PURPOSE: reset the configuration of the development tools +% USAGE: % +% [] = resetDevTools() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 3ee477690385ff13abedefa09e68fa7bf0362b3f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:27:47 +0100 Subject: [PATCH 045/163] Documentation for resetLocalFork --- src/resetLocalFork.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/resetLocalFork.m b/src/resetLocalFork.m index 13a5931..b59d742 100644 --- a/src/resetLocalFork.m +++ b/src/resetLocalFork.m @@ -1,8 +1,13 @@ -function resetLocalFork() -% devTools +function [] = resetLocalFork() +% Clean all files in the working directory and reset the fork % -% PURPOSE: clean all files in the working directory and reset the fork +% USAGE: % +% [] = resetLocalFork() +% +% .. Author: +% - Laurent Heirendt + global gitConf global gitCmd From 1c05a497e64641a1d826be7175b64f27712593af Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:29:24 +0100 Subject: [PATCH 046/163] Documentation for submitContribution --- src/submitContribution.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index 99046a9..ad084d0 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -1,8 +1,15 @@ -function submitContribution(branchName) -% devTools +function [] = submitContribution(branchName) +% Submit an existing feature (branch) named `branchName` % -% PURPOSE: submit an existing feature (branch) named +% USAGE: % +% [] = submitContribution(branchName) +% +% INPUT: +% branchName: Name of the local branch to be pushed to the git server +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 595ba0b9417d31c9a2c36fbeda55302faf960f6e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:30:43 +0100 Subject: [PATCH 047/163] Documentation for updateDevTools --- src/updateDevTools.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/updateDevTools.m b/src/updateDevTools.m index 15902ac..9cda541 100644 --- a/src/updateDevTools.m +++ b/src/updateDevTools.m @@ -1,8 +1,12 @@ -function updateDevTools() -% devTools +function [] = updateDevTools() +% Update the devTools and set the SSH origin if necessary % -% PURPOSE: update the devTools and set the SSH origin if necessary +% USAGE: % +% [] = updateDevTools() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From f188d134efbaf3a08f6f97c621fe183996c4555e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:32:20 +0100 Subject: [PATCH 048/163] Documentation for updateFork --- src/updateFork.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/updateFork.m b/src/updateFork.m index 107fb56..b113829 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -1,8 +1,15 @@ -function updateFork(force) -% devTools +function [] = updateFork(force) +% Updates the fork and the submodules of the repository % -% PURPOSE: updates the fork and the submodules of the repository +% USAGE: % +% [] = updateFork(force) +% +% INPUT: +% force: Boolean flag to use force for updating the fork +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From cd63a8329a87628cefb7d3f4ad62486035963ee4 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 29 Jan 2018 18:33:29 +0100 Subject: [PATCH 049/163] Documentation for updateSubmodules --- src/updateSubmodules.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/updateSubmodules.m b/src/updateSubmodules.m index fc47309..779386c 100644 --- a/src/updateSubmodules.m +++ b/src/updateSubmodules.m @@ -1,8 +1,12 @@ -function updateSubmodules() -% devTools +function [] = updateSubmodules() +% Clones the submodules and updates the repository % -% PURPOSE: clones the submodules and updates the repository +% USAGE: % +% [] = updateSubmodules() +% +% .. Author: +% - Laurent Heirendt global gitConf global gitCmd From 73e9f4638a57cd46ea24a10cd64a948a50c4d0bc Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 19:49:08 +0100 Subject: [PATCH 050/163] add key --- docs/.documenter.enc | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/.documenter.enc diff --git a/docs/.documenter.enc b/docs/.documenter.enc new file mode 100644 index 0000000..e69de29 From de6ff66773ee62bb2f387e797191bf70e88604f3 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Mon, 29 Jan 2018 20:03:58 +0100 Subject: [PATCH 051/163] update .artenolis for key --- .artenolis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.artenolis.yml b/.artenolis.yml index 79f9dc4..8f51993 100644 --- a/.artenolis.yml +++ b/.artenolis.yml @@ -59,6 +59,7 @@ after_success: - if [ "$MATLAB_VER" == "R2016b" ]; then bash <(curl -s https://codecov.io/bash) -f "!*.lst"; export PATH="/home/sbg-jenkins/.local/bin":$PATH; + cd $CURRENT_DIR; pip install --upgrade --user -r docs/requirements.txt; python -c "from documenter.deploy import Documentation; doc = Documentation('github.com/opencobra/MATLAB.devTools', ci='jenkins'); doc.deploy()"; fi From ce27466d5b10eed04734258bcaef929c70cc5186 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 09:27:37 +0100 Subject: [PATCH 052/163] add favicons --- docs/source/_static/img/apple-touch-icon.png | Bin 0 -> 6085 bytes docs/source/_static/img/favicon-16x16.png | Bin 0 -> 1068 bytes docs/source/_static/img/favicon-32x32.png | Bin 0 -> 1687 bytes docs/source/_static/img/favicon.ico | Bin 0 -> 15086 bytes docs/source/_static/img/safari-pinned-tab.svg | 37 ++++++++++++++++++ docs/source/_static/json/manifest.json | 18 +++++++++ docs/source/conf.py | 9 ++++- 7 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 docs/source/_static/img/apple-touch-icon.png create mode 100644 docs/source/_static/img/favicon-16x16.png create mode 100644 docs/source/_static/img/favicon-32x32.png create mode 100644 docs/source/_static/img/favicon.ico create mode 100644 docs/source/_static/img/safari-pinned-tab.svg create mode 100644 docs/source/_static/json/manifest.json diff --git a/docs/source/_static/img/apple-touch-icon.png b/docs/source/_static/img/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fc8de6836eecbbd2aab03503ea2d4565698d05d8 GIT binary patch literal 6085 zcma)AXHXMPun!~6EQY6u{q_a-F>NS7J|C{jX|5_&Jvlq#VJD54_L!O)}y z42UQl0U?4EQ9!DX|Ht>?&Ahp?cf0eu-MPEjo!w+}Q+*}|9tHpaz+`BkV{t(n{~L6) z7qjXpE#iWJ?rNH70swC^A*U`h7yB!21{Nj&Ko|@Fz{ddq#}_O-1po+?0RT3f0RYq! z0D#N4xDBmxA)s|N*4F|2`>&OCR_9!Bz&Jw_UGOrM06jop=ZfGo0Kkbc)X}sInb|4{ zed1tMkhoa+HVDsZ(8D$uL(AlxaGxk6k&I_d5S1y69?*=Y0)c&jG+-TfEk1K3>t%&$ zPw^+)8acz!q;>C{eO~v=V$x$vQ)zyqs@o!_fNQ-Pb- z`?J+uze{$)!Hm5!|Nox$hmv=|q~r0kE`Lt&1YolLk)KG5kH4i~6_LuMdlCWFRFkLL z0z^C`(MJl(i#Ni5gO)6vlTJ=(msFjVc2T>9Cub&Q95??|`UwFUfu^7Xnn-395H2CV zEkC{#nab@^_4;`WW`;8 zj*mH<=?1IG;6qpOU5_QIn#jNC94&3GT6Hi9lrYdT$Fmf(#U(+ zVXD58yKc*ww4G?up|*1f(5Mq$Sj3nXT5?2r*q~-PQ!f>lU}6zP7cS_brU3Ju7AM9N z@w7Q%+^?^#$xjh}j-O^JIw@-P!fI~=A5%9IW-@O4(KFt>Rc4H-S}0&Sg{{d8=zr5A z=k>I)@hBK}GPKbB6(w{3&bFtzqyP4-ZD6SRQV82^3P<#Ju|KKG!?$nF(=!!SI?)!h zsALmG4>dij+XS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|&y6Cg=1itwm_K40!)z{qdvw-?Kak z>90cwg9pS?F%fQ-pZF&7cg~)vinh&x@$yj%gF6@*Lb_0ha4@uRfbrQ2@^wFmn=R|~ z|Fe8cdGrtb&2F(n8K-km$_9wybZv0%E;tXAo4>~e0U%^#Z%E3>O3KMt$|#{^WKeQ4 z*JWfc76+??5&sKt|AD(FCiMRXB)0l?UjS~0S=!(%T!OFo`ai&U-t)ME3-$H5;^~WX z0{}vbSN0g`{H(>qhRsGuhTkm!Kw*fK8w4s0HO^rNLa*rHk-hFf;kTAoM!rrC_L2Jd h`oJT2gEAv2zy{YP+@6+v-h~Q)p{}V;y_R##{{XAdDwY5M literal 0 HcmV?d00001 diff --git a/docs/source/_static/img/favicon-16x16.png b/docs/source/_static/img/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..a9da3d2a9a45902805b7dae04be67654c4934333 GIT binary patch literal 1068 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>Ym%`6Z_?K56Nh6(Xh6gd;}<{ z0(KHUj< zAzoe*8z;w^viS7h z8!=t-(o6r`bQEgeyy5p1Ysm>er%(QSD@3Mt-^aVQymP-*ir4SDz0hCo`aNIugZJhH zFwc9U>FvQ7zS!bymk^7rX>|OQdq8^`lf2zsDi_|laskL;FY)wsWq-sd$H^c+LtWn= zD0J1+#W6(Ua&p1}mYzK|e|mZx*d{k92n%~Sctp5}XdF^e(_<7#crx|L)JfAOrlw4q z93H^J$)Tyadc~@h#-}qgvKmVajIv(8nDYA7#uwRA4ZaBpCMHH^hNi~bH?(|^l!&-_ zW9^#UoVOMh3$GOw-nO=|vfRC+>1|rVgJ)&M-&cJ2^6A^hQ1K*|kAMF#Gc`9kJDolp za+p_Aa)+|g;zh|xJ1ZYO+PhR(sFBI@q~^-Zmv?&hNY0GBY3a~-XHSiS{EK-_hm`8# zCMfPas(MG^yTP<+CykPR$uig%C@gq#`{zcW2USa4BT7;dOH!?pi&B9UgOP!ug|302 zuCYOgfu)s!ft9hLwt*p#5it4iNfZsa`6-!cmAEx1o~teeY6!0ii6{w5ELSKf%1_J8 zNmVGREJ#(zEGS84V5pe$_!AFDVVH)-DgV=FJf8+JFe`KGC36ca3wuu%VHQ?!X)rmQ w!mPYGMB(&}D<_VeIU;j}{d9xJ0xvy=SK@*tpPWpm01boFyt=akR{0I3zang9R* literal 0 HcmV?d00001 diff --git a/docs/source/_static/img/favicon-32x32.png b/docs/source/_static/img/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..1d6637e4b8d1d8a97a35d0039b5c23125edeac54 GIT binary patch literal 1687 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmSN`?>!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+0815<8*Plzi}f$FMOPi zth%GL_R0U}4F5OtUKNm5S@meYoL*%0619~NfC?Z8s0@hUTx3ClQfL|>>PgjwY$KX8 zNaZrE{QZA}Et;z!hA6Ija%p|+zYTUkS(Vj~fCwnwySDc~14BaTT#(2r5CVn|5FM1! znd%Y`3_741hzLY*mP4fS8ie3MS)JMT5z1>GBP)ZOzXSR@u$J-&h!2_~`EUbt1E~*GBQ0hd=)<;y1df?3vVh`R`QcZBD8?|41Ue#8hZ-{~#IVt=@3S zeYyDwm`)hjOFVsD*&i{=aWcryP}lbdO274VaSX9Iot&^hJR#-D!>7qEVu_E$6Ox?5 z6f{(Hl(@nV9Z^x!Q|w&i;Pq=u&l(vY*2#OC7ELk|?vmA7wfyQ8Ny&w585#2~UTV`! zxN zrKLW9(i9@`#4u^{d3_C==#UtukclC$PMzpbj1Q|5DINrC2f;8FW$UbI>pIfKRn)E!$Hkwj>*l5f_nC;S=YC`G)_CWV(!tC zXEO|?g;xD4UZ7=R`Ml}L>*r_JM;|!J$@8PN+u@Vv@~`5}xeuSjY$~}~wBS$IQtif1 z2L!U?S*OJBO?&&Y^qK(c>*aY2C#UDLoNj*f?#s&+zCE+I@5o`jeQ@X6&u>Z={3+|O z2{?L4c6n@>k`Xa-W^eGrPdq(Ezy0Q$^X_+~x3MG{VsS23|CCLm76>}bc;^8O^)6h8OfBKB)(;xZee9%@5v&} z!U`@8CWlj)l{bedoW618#E~;cWR9?(Ztz&(rN{6}T(IPmlj&5T6%3xPelF{r5}E** C`1U^l literal 0 HcmV?d00001 diff --git a/docs/source/_static/img/favicon.ico b/docs/source/_static/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..86ba6144895fbbef26d48801395c64a91b4b318f GIT binary patch literal 15086 zcmeI2dvH|M9mnsoKtR9%gYqT;l94wkrG*9w%0q0YEmT_{gJRLvRxDN2PHn3Zwd&X+ z6yJg{fCvOAK`0%im4r|MYX_$aCA1^~Lg|B+O~JAuo4x&fH+$pBd@K9oz&TKsDG=He);0Pu;i}S_i;72tpy0!G1_d9nj~4dGKFw zbj$9Bq(*x*_JiMm4b|`#AFSSOFo>y-JwiF2^g57JpQq+FErO32%W} z2lF``<(}U4K3?Uyuc4zO>;Olz+y0w-CE#e+{bFF2n%Ey&REK*(Z5^);H&{_C9Eg)w})-wEwh}`XO{ofFq62UPIbt(4=n} zS`w*)*{?n!&v)vpu8pB#B&dHk)Xwhfe<$rz(A}%NM6X5bFc0gz(|R9vfT`OIpX6Sy zSw0%FL4DY*(TuB~l)`rS5sZeU=Rned9=#8D!D(0zTfx-q4!_6!{>qDnOxOvgRx_+| zbUo<3$bdBEOZ6Xm^li8W^lfnKb;m1*_1!(K>UZ7xpeNQ?bB6o#A)#+;D(Zyx8Bh|V z4rhn;EuO#c<(z@&+6HD@o8fs=M_9_1Mp*5oiqCHlhIfm}9G{#qRrA4>qs`tQ0L;CEQdt}|P z!DxRQeP%x~!x~>^G?$*Hlsmj{k-tZ$gO?v%J$m@@{OnyZv>)Z()Ta1o?mU0{RpwZ< zY3*UQwHZEoB7bn)`EPU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%(4>+_OkV{7*^V4 zw(C#(6k3dALft+^lV^(*66cROln=T?gI?(C{b3x`>$B0kH(|9lo(UJdi{u#(`abBa zy*<>e-${Q3Xbn{g%b{KwN((DMYZ#3?nm^b5CX4hvArIbxzkt?gUvsKV+5zxq&>UD} zMk&<$JsRot+cvGE-Ua;z`sna}yRWV(?9zp_uY<-p{r=<-JPa3|dyz-$*W%JGr2y?z`(%7J0Om zJsBnPJ!0M)X=BE?+hHYmjt + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + + diff --git a/docs/source/_static/json/manifest.json b/docs/source/_static/json/manifest.json new file mode 100644 index 0000000..f784358 --- /dev/null +++ b/docs/source/_static/json/manifest.json @@ -0,0 +1,18 @@ +{ + "name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 4037591..f3732c3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -173,7 +173,12 @@ def linkcode_resolve(domain, info): 'github_repo': 'MATLAB.devTools', 'github_version': 'master', 'logo': 'img/logo_devTools.png', - 'theme_logo_only': True, + 'favicon-apple-touch': 'img/apple-touch-icon.png', + 'favicon32x32': 'favicon-32x32.png', + 'favicon16x16': 'favicon-16x16.png', + 'favicon-safari-pinned-tab': 'safari-pinned-tab.svg', + 'manifest': 'json/manifest.json', + 'theme_logo_only': False, 'show_source': False} # 'display_github': True} # Add any paths that contain custom themes here, relative to this directory. @@ -197,7 +202,7 @@ def linkcode_resolve(domain, info): # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # -html_favicon = '_static/img/logo_devTools.ico' +html_favicon = '_static/img/favicon.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From 6dca031e62a7a48f1b92278ce7c60ad77ef1af56 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 09:30:50 +0100 Subject: [PATCH 053/163] update manifest --- .../_static/img/android-chrome-192x192.png | Bin 0 -> 6408 bytes .../_static/img/android-chrome-384x384.png | Bin 0 -> 16703 bytes docs/source/_static/json/manifest.json | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 docs/source/_static/img/android-chrome-192x192.png create mode 100644 docs/source/_static/img/android-chrome-384x384.png diff --git a/docs/source/_static/img/android-chrome-192x192.png b/docs/source/_static/img/android-chrome-192x192.png new file mode 100644 index 0000000000000000000000000000000000000000..6bc6706b6f6eaf9841a1ad92b568863527d11716 GIT binary patch literal 6408 zcmb7Ic|6m9{Qt~mj3G9+9LdZ*N63+5BRNMZUn)bgiV!hZ+vLcVgmRmsNQp`)WR9rZ zDkR5RiYP4CWbs>n{{Hy=@q4_F*Zci?KVQe={m1+De!Wug&PRm=WCQ>J5ISaubK_F_ zzrhdX&TdnId|UzvuyV2jfG3%P93NipUeV9a%?SXaQ2;o|8QuNZ*jC%m}bvTLx_Wm_mTU9of!xw(c$%c;!l7|5bd8#@tT=0WqI4gJ3`J);fQ@p<3jv%Jp>?3>_RxjJ%pxw6cy0+NWQLR8PNIKOJ z>o8JAobpt&LR6|>hAEXPSv^)g9I(r7+nJj-jahlN<+;K;?(CcY&U?nO2C__3xFsOg96Dm@_&jYS`m8=7bKEMB!|4*-FyOT2} z@|7_k(FJFo>MFAvhxOyj-9z%ad2h)q`rPN4JKins@Qvs3=b_Q?q zB{h3Tf=&UmJQBSas}?DS6hr+a`ALSG49XmST5yU_Qx8$u3sWG#F`~u-Qm)_bIZzxZ zY1GKyhFmluj&bE&LZzmyc_$g%4!)BoTF{Hwg%X>?1nSK=M;r7i-co&^Q0NK!BiN1Xhd&`5b*S7Zwfhxp~#S= zZ@G#TxpOo|I7|1;N-JvN3>N>zj9syX=nBdnk2CMsVmQK>6`X)0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~q=Vb`N+C!}T z%$-s12nQ*NGQcP_Kxs-kG6C*4nrj#5-m8L`uXJZrXr({OWybL&(K8t`uO5Tm)lC>S zH`)Etf&cz@qrmP#2Io~~=u7iztV4b8bB~g|UBXQ`_be=S7*3!qtbI{~_s3sG*>?0d zVgahO1btDD0!6wRCc&FwY#dh`{^M-I<1(wQ$^7jw^UYd&_8kC- zejVjmv#Vvib6xhyBdVav7@VM|h2ds@Ey2t56uzDG*3<`6o!&C#I5NB(#$fj7Ccw^> zIie}n`Qy=XKIleQjBJqKEnXFx{CnH%0*2X{&Indhku>lI^K@qFB4>r=4qmi_oj+YE z>zt`#BW=;sT?M0Mv^EEoL7TBjCIs}Zu20e8 zQ6b#asuy5h9}bD@FrlSjMXwtgX}7ON$noa+-x{=%c?LRkl+Orul>Zs!A90l&2hfmm z0vYd02H_$)k|G$IS=eWB- zhs&|ft`Sb&QKI3u!~6q7{6r&S!u>=8!y|k^py-N~UrcnjE+LU097aD{{cr+7B^Z@_ z7!eW(n<7pqLevzaG2jc8Xm=JJ{XRJ|_;FBhkaiSfiL+J$ZSk;2{4& Date: Tue, 30 Jan 2018 09:38:07 +0100 Subject: [PATCH 054/163] update manifest --- docs/source/_static/json/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/_static/json/manifest.json b/docs/source/_static/json/manifest.json index db00030..870e24e 100644 --- a/docs/source/_static/json/manifest.json +++ b/docs/source/_static/json/manifest.json @@ -2,12 +2,12 @@ "name": "", "icons": [ { - "src": "_static/img/android-chrome-192x192.png", + "src": "../img/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, { - "src": "_static/img/android-chrome-384x384.png", + "src": "../img/android-chrome-384x384.png", "sizes": "384x384", "type": "image/png" } From a679538ce3f55effcc9ab05f91d0eb97056a05b7 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 09:39:42 +0100 Subject: [PATCH 055/163] fix image URLs --- docs/source/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index f3732c3..c876355 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -174,9 +174,9 @@ def linkcode_resolve(domain, info): 'github_version': 'master', 'logo': 'img/logo_devTools.png', 'favicon-apple-touch': 'img/apple-touch-icon.png', - 'favicon32x32': 'favicon-32x32.png', - 'favicon16x16': 'favicon-16x16.png', - 'favicon-safari-pinned-tab': 'safari-pinned-tab.svg', + 'favicon32x32': 'img/favicon-32x32.png', + 'favicon16x16': 'img/favicon-16x16.png', + 'favicon-safari-pinned-tab': 'img/safari-pinned-tab.svg', 'manifest': 'json/manifest.json', 'theme_logo_only': False, 'show_source': False} From 805ad57ebee31a4516b148648b220a46c8d64dbc Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 09:43:44 +0100 Subject: [PATCH 056/163] add browser config for microsoft products --- docs/source/_static/browserconfig.xml | 9 +++++++++ docs/source/conf.py | 1 + 2 files changed, 10 insertions(+) create mode 100644 docs/source/_static/browserconfig.xml diff --git a/docs/source/_static/browserconfig.xml b/docs/source/_static/browserconfig.xml new file mode 100644 index 0000000..b3930d0 --- /dev/null +++ b/docs/source/_static/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index c876355..c11f10c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -178,6 +178,7 @@ def linkcode_resolve(domain, info): 'favicon16x16': 'img/favicon-16x16.png', 'favicon-safari-pinned-tab': 'img/safari-pinned-tab.svg', 'manifest': 'json/manifest.json', + 'browserconfig': 'browserconfig.xml', 'theme_logo_only': False, 'show_source': False} # 'display_github': True} From 20efdcaaebb910907c282936161adf2cbd59113a Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 09:55:39 +0100 Subject: [PATCH 057/163] Converted README to RST format --- README.md | 81 ------------------------------------------------------ README.rst | 8 +++--- 2 files changed, 4 insertions(+), 85 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 8c5e93c..0000000 --- a/README.md +++ /dev/null @@ -1,81 +0,0 @@ -

- -

-
- -| MATLAB R2016b | MATLAB R2015b | Code Coverage | Code Grade | -|--------|--------|--------|--------| -| [![Build Status](https://prince.lcsb.uni.lu/jenkins/buildStatus/icon?job=devTools-branches-auto/MATLAB_VER=R2016b)](https://prince.lcsb.uni.lu/jenkins/job/devTools-branches-auto/MATLAB_VER=R2016b/) | [![Build Status](https://prince.lcsb.uni.lu/jenkins/buildStatus/icon?job=devTools-branches-auto/MATLAB_VER=R2015b)](https://prince.lcsb.uni.lu/jenkins/job/devTools-branches-auto/MATLAB_VER=R2015b/)| [![codecov](https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master/graph/badge.svg)](https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master) | ![Code grade](https://prince.lcsb.uni.lu/jenkins/userContent/codegrade-MATLABdevTools.svg?maxAge=0 "Ratio of the number of inefficient code lines and the total number of lines of code (in percent). A: 0-3%, B: 3-6%, C: 6-9%, D: 9-12%, E: 12-15%, F: > 15%.") - -# MATLAB.devTools - Contribute the smart way - -## Pre-requisites - -Please follow the [configuration instructions](https://github.com/opencobra/MATLAB.devTools/blob/master/PREREQUISITES.md) carefully. You may skip this if your system is already set up and you have `git` configured. - -warning **IMPORTANT**: Please make sure that you have configured your SSH key in Github as explained [here](https://github.com/opencobra/MATLAB.devTools/blob/master/PREREQUISITES.md). - -## Installation - -Download this repository (the folder `./MATLAB.devTools/` will be created). You can clone the repository using: -````bash -$ git clone git@github.com:opencobra/MATLAB.devTools.git MATLAB.devTools -```` -warning Run this command in `Terminal` (on macOS and Linux) or in `Git Bash` (on Windows) - **not** in Matlab. - -Some issues that can arise during installation are addressed in the [FAQ](https://github.com/opencobra/MATLAB.devTools/blob/master/FAQ.md). - -## Do you want to contribute to The COBRA Toolbox? - -Please follow the [installation and contributing instructions](https://github.com/opencobra/cobratoolbox/blob/master/README.rst). - -[![asciicast](https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy.png)](https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy) - -## How do I use the `MATLAB.devTools`? - -Making a contribution to any `git` repository from Matlab is straightforward. Type in Matlab within the `MATLAB.devTools` folder: -```Matlab ->> contribute -``` - -You will then be presented by a menu: -``` - [1] Start a new feature (branch). - [2] Select an existing feature (branch) to work on. - [3] Publish a feature (branch). - [4] Delete a feature (branch). - [5] Update the fork. - --> Please select what you want to do (enter the number): -``` - -The original repository will be downloaded (cloned) the first time to a folder named `fork-gitRepoName`. **Only files in the `fork-gitRepoName` folder** will be considered for contribution (any changes made to a downloaded official `git` repository will be ignored). - -warning If you get stuck or are faced with an system error message, please read the [FAQ](https://github.com/opencobra/MATLAB.devTools/blob/master/FAQ.md). - -## How can I update my fork without contributing? - -In order to only update your fork, run `>> contribute` and select menu item `[5]`. - -## Configure the `MATLAB.devTools` for another repository - -warning The `MATLAB.devTools` can only be used with **publicly accessible** repositories. - -If you want to use the `MATLAB.devTools` with a repository other than the default repository, you must set the following variables: - -```Matlab -launcher = '\n\n ~~~ MATLAB.devTools ~~~\n\n'; % a message for the repository (any string) -remoteRepoURL = 'https://server.com/repositoryName.git'; % the remote url -nickName = 'repoNickName'; % a nickName of the repository (any string) -printLevel = 0; % set the printLevel mode -``` -and run: -```Matlab ->> confDevTools(launcher, remoteRepoURL, nickName, printLevel); % sets the configuration -``` - -In order to reset the configuration, type: -```Matlab ->> resetDevTools(); -``` -If you want your changes to be permanent, you can set the above mentioned variables in `./assets/confDevTools.m`. diff --git a/README.rst b/README.rst index 1b5a3dc..2c77c43 100644 --- a/README.rst +++ b/README.rst @@ -21,13 +21,13 @@ Pre-requisites .. begin-prerequisites-marker Please follow the `configuration -instructions `__ +instructions `__ carefully. You may skip this if your system is already set up and you have ``git`` configured. **IMPORTANT**: Please make sure that you have configured your SSH key in Github as explained -`here `__. +`here `__. .. end-prerequisites-marker @@ -47,7 +47,7 @@ created). You can clone the repository using: **not** in . Some issues that can arise during installation are addressed in the -`FAQ `__. +`FAQ `__. .. end-installation-marker @@ -91,7 +91,7 @@ ignored). If you get stuck or are faced with an system error message, please read the -`FAQ `__. +`FAQ `__. .. end-getstarted-marker From 272f74666b3f30075ebd88b8a5dff2b7b38b7ff9 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 10:10:36 +0100 Subject: [PATCH 058/163] fix indent --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 2c77c43..272744b 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ instructions `__. @@ -43,7 +43,7 @@ created). You can clone the repository using: $ git clone git@github.com:opencobra/MATLAB.devTools.git MATLAB.devTools - Run this command in ``Terminal`` (on and ) or in ``Git Bash`` (on ) - +Run this command in ``Terminal`` (on and ) or in ``Git Bash`` (on ) - **not** in . Some issues that can arise during installation are addressed in the @@ -89,7 +89,7 @@ folder named ``fork-gitRepoName``. **Only files in the changes made to a downloaded official ``git`` repository will be ignored). - If you get stuck or are faced with an system error message, please read +If you get stuck or are faced with an system error message, please read the `FAQ `__. @@ -104,7 +104,7 @@ item ``[5]``. Configure the ``MATLAB.devTools`` for another repository -------------------------------------------------------- - The ``MATLAB.devTools`` can only be used with **publicly accessible** +The ``MATLAB.devTools`` can only be used with **publicly accessible** repositories. If you want to use the ``MATLAB.devTools`` with a repository other than From 02ea279f57d26a628d92b8308cefbfbac0c4f37b Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 10:14:16 +0100 Subject: [PATCH 059/163] fix conversion error --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 272744b..18b1b3c 100644 --- a/README.rst +++ b/README.rst @@ -85,7 +85,7 @@ You will then be presented by a menu: The original repository will be downloaded (cloned) the first time to a folder named ``fork-gitRepoName``. **Only files in the -``fork-gitRepoName`` folder** will be considered for contribution (any +fork-gitRepoName folder** will be considered for contribution (any changes made to a downloaded official ``git`` repository will be ignored). From 1e2772734b817c8d7c15a7cb6d8c19354004a1f3 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 30 Jan 2018 11:08:06 +0100 Subject: [PATCH 060/163] Reset path to fork --- src/resetDevTools.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resetDevTools.m b/src/resetDevTools.m index 94bd6f3..305b8ba 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -15,7 +15,7 @@ checkSystem(mfilename); % unset the path to the local fork - [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset-all user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); + [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); if status_gitConfForkDirGet == 0 printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); From 9d439c0affc7be23cc6842dd7b19ce8c479c197a Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 12:01:43 +0100 Subject: [PATCH 061/163] fix generateJSONlist --- docs/generateJSONList.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/generateJSONList.py b/docs/generateJSONList.py index 20bb0a7..53f9038 100644 --- a/docs/generateJSONList.py +++ b/docs/generateJSONList.py @@ -24,14 +24,15 @@ def mkdir_p(path): def path_to_list(path): d = [] path_length = len(path) + print path_length, path for root, directories, filenames in os.walk(path): for filename in filenames: print os.path.join('source', 'modules', root[path_length+1:], 'index.rst') if filename[-2:] == '.m' and os.path.isfile(os.path.join('source', 'modules', root[path_length+1:], 'index.rst')): website_url = os.path.join("modules", root[path_length+1:], "index.html") website_url += "?highlight=" + filename[:-2] - website_url += "#" + '.'.join(['src'] + root[path_length+1:].split(os.path.sep) + [filename[:-2]]) - d.append({'name': filename[:-2], + website_url += "#" + '.'.join(['src'] + [filename[:-2]]) + d.append({'name': filename[:-2], 'website_url': website_url}) print root, filename return d From c9b86687367cec1de2836b2d9e7b02a357084f70 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 12:06:23 +0100 Subject: [PATCH 062/163] fix config for microsoft and apple --- docs/source/_static/browserconfig.xml | 2 +- docs/source/_static/img/mstile-150x150.png | Bin 0 -> 4946 bytes docs/source/conf.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 docs/source/_static/img/mstile-150x150.png diff --git a/docs/source/_static/browserconfig.xml b/docs/source/_static/browserconfig.xml index b3930d0..ba99813 100644 --- a/docs/source/_static/browserconfig.xml +++ b/docs/source/_static/browserconfig.xml @@ -2,7 +2,7 @@ - + #da532c diff --git a/docs/source/_static/img/mstile-150x150.png b/docs/source/_static/img/mstile-150x150.png new file mode 100644 index 0000000000000000000000000000000000000000..1a5cebdd93160eeaec236bcdae5f9794546b6e1f GIT binary patch literal 4946 zcmcgwXIK+kn4TC&p%)d5p-H_UJ&_%_Rs#% z0f2c=066*p0HnzI4UWdp2gH?ARu;hSzegeCSr#;cjIgmgiToQTiw5K#sA@X^fcUD7 z#fftc$%cO)xO-JaCAKHVpo>3FkwKfbOtOhXi#UZtpW>rd+6 zw`5PstJf8&{J3$!LQabw#=Q=vS`B7b9QLMuK~MP4hc7z30m;A; zhFpRVS*R}H-Xb4X1bgRQgb`VhtjP-m)xic_#*u8d&xsvy(lPLiJlxc{(q}WHsta!~ zlmTs&7+AO-wB96tAm`Hk65)h-EJOY+WPwAQTog&m-j}pGubeL}+MQ2%H=29{ifYTumMZeyV9BdX7nkvauNN^X z+8wdXwu1XQXDx(wHm8aN7dC$3^(BkimpyDQUHCIoFopE-X;_32?}*t_M~Rl{=3Wq* zBH@P*&@Za2 zmh?bs9d2ZD+CXV1f9$q60qru}+Wr$E@<-!>;KPTx<1#T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conf.py @@ -173,10 +173,10 @@ def linkcode_resolve(domain, info): 'github_repo': 'MATLAB.devTools', 'github_version': 'master', 'logo': 'img/logo_devTools.png', - 'favicon-apple-touch': 'img/apple-touch-icon.png', + 'favicon_apple_touch': 'img/apple-touch-icon.png', 'favicon32x32': 'img/favicon-32x32.png', 'favicon16x16': 'img/favicon-16x16.png', - 'favicon-safari-pinned-tab': 'img/safari-pinned-tab.svg', + 'favicon_safari_pinned_tab': 'img/safari-pinned-tab.svg', 'manifest': 'json/manifest.json', 'browserconfig': 'browserconfig.xml', 'theme_logo_only': False, From e395f424aba9be3dc6a863179e08fc05c83431e0 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 12:10:20 +0100 Subject: [PATCH 063/163] fix config for microsoft --- docs/source/_static/browserconfig.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/_static/browserconfig.xml b/docs/source/_static/browserconfig.xml index ba99813..efcaaf6 100644 --- a/docs/source/_static/browserconfig.xml +++ b/docs/source/_static/browserconfig.xml @@ -2,7 +2,7 @@ - + #da532c From 721d42e0601b6839cde118e46e192910a3ef1d12 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 30 Jan 2018 13:31:05 +0100 Subject: [PATCH 064/163] Removing [] --- src/checkDevTools.m | 4 ++-- src/checkLocalFork.m | 4 ++-- src/checkRemoteFork.m | 4 ++-- src/checkStatus.m | 4 ++-- src/checkSystem.m | 4 ++-- src/checkoutBranch.m | 4 ++-- src/configureFork.m | 4 ++-- src/deleteContribution.m | 4 ++-- src/history.m | 4 ++-- src/initContribution.m | 4 ++-- src/initDevTools.m | 4 ++-- src/openPR.m | 4 ++-- src/printMsg.m | 4 ++-- src/resetDevTools.m | 4 ++-- src/resetLocalFork.m | 4 ++-- src/submitContribution.m | 4 ++-- src/updateDevTools.m | 4 ++-- src/updateFork.m | 4 ++-- src/updateSubmodules.m | 4 ++-- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/checkDevTools.m b/src/checkDevTools.m index a261507..79c97e3 100644 --- a/src/checkDevTools.m +++ b/src/checkDevTools.m @@ -1,9 +1,9 @@ -function [] = checkDevTools() +function checkDevTools() % Checks the configuration of the development tools % % USAGE: % -% [] = checkDevTools() +% checkDevTools() % % .. Author: % - Laurent Heirendt diff --git a/src/checkLocalFork.m b/src/checkLocalFork.m index 2fe140a..db636fe 100644 --- a/src/checkLocalFork.m +++ b/src/checkLocalFork.m @@ -1,9 +1,9 @@ -function [] = checkLocalFork() +function checkLocalFork() % Checks the configuration of remotes in the local copy of the fork % % USAGE: % -% [] = checkLocalFork() +% checkLocalFork() % % .. Author: % - Laurent Heirendt diff --git a/src/checkRemoteFork.m b/src/checkRemoteFork.m index ad373db..3c395aa 100644 --- a/src/checkRemoteFork.m +++ b/src/checkRemoteFork.m @@ -1,9 +1,9 @@ -function [] = checkRemoteFork() +function checkRemoteFork() % Checks whether the fork exists remotely % % USAGE: % -% [] = checkRemoteFork() +% checkRemoteFork() % % .. Author: % - Laurent Heirendt diff --git a/src/checkStatus.m b/src/checkStatus.m index 790ba20..6e728bc 100644 --- a/src/checkStatus.m +++ b/src/checkStatus.m @@ -1,9 +1,9 @@ -function [] = checkStatus() +function checkStatus() % Checks the status of the repository % % USAGE: % -% [] = checkStatus() +% checkStatus() % % .. Author: % - Laurent Heirendt diff --git a/src/checkSystem.m b/src/checkSystem.m index ef244e6..31a4970 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -1,9 +1,9 @@ -function [] = checkSystem(callerName) +function checkSystem(callerName) % Checks the configuration of the system (installation of git and curl) % % USAGE: % -% [] = checkSystem(callerName) +% checkSystem(callerName) % % INPUT: % callerName: Name of the function calling `checkSystem()` diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 7ef2055..fb8e07b 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -1,9 +1,9 @@ -function [] = checkoutBranch(branchName, updateForkFlag) +function checkoutBranch(branchName, updateForkFlag) % checks out a branch named locally and remotely % % USAGE: % -% [] = checkoutBranch(branchName, updateForkFlag) +% checkoutBranch(branchName, updateForkFlag) % % INPUT: % branchName: Name of the local branch to be checked out diff --git a/src/configureFork.m b/src/configureFork.m index f282ad1..2071f95 100644 --- a/src/configureFork.m +++ b/src/configureFork.m @@ -1,9 +1,9 @@ -function [] = configureFork() +function configureFork() % Configures the remotes of the local fork (upstream) % % USAGE: % -% [] = configureFork() +% configureFork() % % .. Author: % - Laurent Heirendt diff --git a/src/deleteContribution.m b/src/deleteContribution.m index b7e2961..68e15d6 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -1,9 +1,9 @@ -function [] = deleteContribution(branchName) +function deleteContribution(branchName) % Deletes and existing feature (branch) named % % USAGE: % -% [] = deleteContribution(branchName) +% deleteContribution(branchName) % % INPUT: % branchName: Name of the local branch to be deleted diff --git a/src/history.m b/src/history.m index 4b91289..fa235cf 100644 --- a/src/history.m +++ b/src/history.m @@ -1,9 +1,9 @@ -function [] = history(fileName) +function history(fileName) % Displays the history of a file % % USAGE: % -% [] = history(fileName) +% history(fileName) % % INPUT: % fileName: Name of the file for which the history shall be displayed diff --git a/src/initContribution.m b/src/initContribution.m index 355dc64..c3714d8 100644 --- a/src/initContribution.m +++ b/src/initContribution.m @@ -1,9 +1,9 @@ -function [] = initContribution(branchName) +function initContribution(branchName) % Initializes a new feature (branch) named `branchName` % % USAGE: % -% [] = initContribution(branchName) +% initContribution(branchName) % % INPUT: % branchName: Name of the local branch to be initialized diff --git a/src/initDevTools.m b/src/initDevTools.m index 98349b2..b80ddd5 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -1,9 +1,9 @@ -function [] = initDevTools() +function initDevTools() % Initializes the development tools (username and email are requested if not configured) % % USAGE: % -% [] = initDevTools() +% initDevTools() % % .. Author: % - Laurent Heirendt diff --git a/src/openPR.m b/src/openPR.m index 94f5bac..7edece7 100644 --- a/src/openPR.m +++ b/src/openPR.m @@ -1,9 +1,9 @@ -function [] = openPR(branchName) +function openPR(branchName) % Provides a pull request URL from to on the upstream % % USAGE: % -% [] = openPR(branchName) +% openPR(branchName) % % INPUT: % branchName: Name of the branch for which a pull request (PR) shall be opened diff --git a/src/printMsg.m b/src/printMsg.m index 0c445c2..876b392 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -1,9 +1,9 @@ -function [] = printMsg(fileName, msg, endMsg) +function printMsg(fileName, msg, endMsg) % Print a message % % USAGE: % -% [] = printMsg(fileName, msg, endMsg) +% printMsg(fileName, msg, endMsg) % % INPUT: % fileName: Name of the file from which the message is issued diff --git a/src/resetDevTools.m b/src/resetDevTools.m index 305b8ba..fc731aa 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -1,9 +1,9 @@ -function [] = resetDevTools() +function resetDevTools() % Reset the configuration of the development tools % % USAGE: % -% [] = resetDevTools() +% resetDevTools() % % .. Author: % - Laurent Heirendt diff --git a/src/resetLocalFork.m b/src/resetLocalFork.m index b59d742..b28b41d 100644 --- a/src/resetLocalFork.m +++ b/src/resetLocalFork.m @@ -1,9 +1,9 @@ -function [] = resetLocalFork() +function resetLocalFork() % Clean all files in the working directory and reset the fork % % USAGE: % -% [] = resetLocalFork() +% resetLocalFork() % % .. Author: % - Laurent Heirendt diff --git a/src/submitContribution.m b/src/submitContribution.m index ad084d0..9659d48 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -1,9 +1,9 @@ -function [] = submitContribution(branchName) +function submitContribution(branchName) % Submit an existing feature (branch) named `branchName` % % USAGE: % -% [] = submitContribution(branchName) +% submitContribution(branchName) % % INPUT: % branchName: Name of the local branch to be pushed to the git server diff --git a/src/updateDevTools.m b/src/updateDevTools.m index 9cda541..6a94d30 100644 --- a/src/updateDevTools.m +++ b/src/updateDevTools.m @@ -1,9 +1,9 @@ -function [] = updateDevTools() +function updateDevTools() % Update the devTools and set the SSH origin if necessary % % USAGE: % -% [] = updateDevTools() +% updateDevTools() % % .. Author: % - Laurent Heirendt diff --git a/src/updateFork.m b/src/updateFork.m index b113829..e8e7478 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -1,9 +1,9 @@ -function [] = updateFork(force) +function updateFork(force) % Updates the fork and the submodules of the repository % % USAGE: % -% [] = updateFork(force) +% updateFork(force) % % INPUT: % force: Boolean flag to use force for updating the fork diff --git a/src/updateSubmodules.m b/src/updateSubmodules.m index 779386c..8ce009b 100644 --- a/src/updateSubmodules.m +++ b/src/updateSubmodules.m @@ -1,9 +1,9 @@ -function [] = updateSubmodules() +function updateSubmodules() % Clones the submodules and updates the repository % % USAGE: % -% [] = updateSubmodules() +% updateSubmodules() % % .. Author: % - Laurent Heirendt From 605681765a9cbf35bf4d5a49753e58716f7e6c33 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 17:55:24 +0100 Subject: [PATCH 065/163] fix emoji, add citation and faq sections --- README.rst | 82 +++++++++++++++++++++++++++++++---- docs/source/cite.rst | 62 ++++++++++++++++++++++++++ docs/source/contents.rst | 5 ++- docs/source/contribute.rst | 33 ++++++++++++++ docs/source/faq.rst | 89 ++++++++++++++++++++------------------ 5 files changed, 220 insertions(+), 51 deletions(-) create mode 100644 docs/source/cite.rst create mode 100644 docs/source/contribute.rst diff --git a/README.rst b/README.rst index 18b1b3c..6bb0620 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ instructions `__. @@ -43,8 +43,8 @@ created). You can clone the repository using: $ git clone git@github.com:opencobra/MATLAB.devTools.git MATLAB.devTools -Run this command in ``Terminal`` (on and ) or in ``Git Bash`` (on ) - -**not** in . +|important| Run this command in ``Terminal`` (on |macOS| and |linux|) or in ``Git Bash`` (on |windows|) - +**not** in |matlab|. Some issues that can arise during installation are addressed in the `FAQ `__. @@ -64,8 +64,8 @@ How do I use the ``MATLAB.devTools``? .. begin-getstarted-marker -Making a contribution to any ``git`` repository from is straightforward. -Type in within the ``MATLAB.devTools`` folder: +Making a contribution to any ``git`` repository from |matlab| is straightforward. +Type in |matlab| within the ``MATLAB.devTools`` folder: .. code:: matlab @@ -89,7 +89,7 @@ fork-gitRepoName folder** will be considered for contribution (any changes made to a downloaded official ``git`` repository will be ignored). -If you get stuck or are faced with an system error message, please read +|important| If you get stuck or are faced with an system error message, please read the `FAQ `__. @@ -104,7 +104,9 @@ item ``[5]``. Configure the ``MATLAB.devTools`` for another repository -------------------------------------------------------- -The ``MATLAB.devTools`` can only be used with **publicly accessible** +.. begin-contribute-other-repo-marker + +|important| The ``MATLAB.devTools`` can only be used with **publicly accessible** repositories. If you want to use the ``MATLAB.devTools`` with a repository other than @@ -130,7 +132,41 @@ In order to reset the configuration, type: >> resetDevTools(); If you want your changes to be permanent, you can set the above -mentioned variables in ``./assets/confDevTools.m``. +mentioned variables in ``./src/confDevTools.m``. + +.. end-contribute-other-repo-marker + + +How to cite the ``MATLAB.devTools`` +----------------------------------- + +.. begin-how-to-cite-marker + +The ``MATLAB.devTools`` has been developped first for the COBRA Toolbox and +thus when citing the ``MATLAB.devTools``, one should refer to the following +paper: + + Laurent Heirendt & Sylvain Arreckx, Thomas Pfau, Sebastian N. + Mendoza, Anne Richelle, Almut Heinken, Hulda S. Haraldsdottir, Jacek + Wachowiak, Sarah M. Keating, Vanja Vlasov, Stefania Magnusdottir, + Chiam Yu Ng, German Preciat, Alise Zagare, Siu H.J. Chan, Maike K. + Aurich, Catherine M. Clancy, Jennifer Modamio, John T. Sauls, + Alberto Noronha, Aarash Bordbar, Benjamin Cousins, Diana C. El + Assal, Luis V. Valcarcel, Inigo Apaolaza, Susan Ghaderi, Masoud + Ahookhosh, Marouen Ben Guebila, Andrejs Kostromins, Nicolas + Sompairac, Hoai M. Le, Ding Ma, Yuekai Sun, Lin Wang, James T. + Yurkovich, Miguel A.P. Oliveira, Phan T. Vuong, Lemmer P. El Assal, + Inna Kuperstein, Andrei Zinovyev, H. Scott Hinton, William A. + Bryant, Francisco J. Aragon Artacho, Francisco J. Planes, Egils + Stalidzans, Alejandro Maass, Santosh Vempala, Michael Hucka, Michael + A. Saunders, Costas D. Maranas, Nathan E. Lewis, Thomas Sauter, + Bernhard Ø. Palsson, Ines Thiele, Ronan M.T. Fleming, **Creation and + analysis of biochemical constraint-based models: the COBRA Toolbox + v3.0** (submitted), 2017, + `arXiv:1710.04038 `__. + +.. end-how-to-cite-marker + .. |Build Status| image:: https://prince.lcsb.uni.lu/jenkins/buildStatus/icon?job=devTools-branches-auto/MATLAB_VER=R2016b :target: https://prince.lcsb.uni.lu/jenkins/job/devTools-branches-auto/MATLAB_VER=R2016b/ @@ -139,5 +175,35 @@ mentioned variables in ``./assets/confDevTools.m``. .. |codecov| image:: https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master/graph/badge.svg :target: https://codecov.io/gh/opencobra/MATLAB.devTools/branch/master .. |Code grade| image:: https://prince.lcsb.uni.lu/jenkins/userContent/codegrade-MATLABdevTools.svg?maxAge=0 + + +.. begin-screencast-marker + .. |asciicast| image:: https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy.png :target: https://asciinema.org/a/7zg2ce5gfth7ruywptgc3i3yy + +.. end-screencast-marker + + +.. begin-icon-marker +.. |macos| raw:: html + + macOS + +.. |linux| raw:: html + + linux + +.. |windows| raw:: html + + windows + +.. |matlab| raw:: html + + matlab + +.. |important| raw:: html + + bulb + +.. end-icon-marker diff --git a/docs/source/cite.rst b/docs/source/cite.rst new file mode 100644 index 0000000..a8af629 --- /dev/null +++ b/docs/source/cite.rst @@ -0,0 +1,62 @@ +How to cite +=========== + +.. include:: ../../README.rst + :start-after: begin-how-to-cite-marker + :end-before: end-how-to-cite-marker + + +.. |macos| raw:: html + + macOS + + +.. |linux| raw:: html + + linux + + +.. |windows| raw:: html + + windows + + +.. |warning| raw:: html + + warning + + +.. |matlab| raw:: html + + matlab + + +.. |tada| raw:: html + + tada + + +.. |thumbsup| raw:: html + + thumbsup + + +.. |bulb| raw:: html + + bulb + + +.. |tutorials| raw:: html + + + + +.. |latest| raw:: html + + + + +.. |forum| raw:: html + + + diff --git a/docs/source/contents.rst b/docs/source/contents.rst index 52e882e..19f6c81 100644 --- a/docs/source/contents.rst +++ b/docs/source/contents.rst @@ -4,10 +4,11 @@ MATLAB.devTools .. toctree:: :maxdepth: 2 - index + Home installation getstarted + contribute modules/index - support faq + cite funding diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst new file mode 100644 index 0000000..d095ccb --- /dev/null +++ b/docs/source/contribute.rst @@ -0,0 +1,33 @@ +.. _contribute: + +Contribute to projects +====================== + + +The COBRA Toolbox +----------------- + +|asciicast| + +.. include:: ../../README.rst + :start-after: begin-screencast-marker + :end-before: end-screencast-marker + + +COBRA.tutorials +--------------- + +To come! + + +Other repository +---------------- + +.. include:: ../../README.rst + :start-after: begin-contribute-other-repo-marker + :end-before: end-contribute-other-repo-marker + +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 605b3d5..2b10c27 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -3,8 +3,52 @@ Frequently Asked Questions (FAQ) ================================ +General questions +----------------- + +How should I name my contribution? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Initiate a contribution per theme/topic/feature/bug fix that you work +on. Don’t mix features and think of an explicit name, i.e. +``bug-fix-function1`` or ``add-tests-function2``. Avoid generic names, +such as ``my-great-feature`` or ``fix`` or ``contribution-myName``. + +How can I check the history of a file? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can check the history of a file by typing in MATLAB: + +.. code:: matlab + + >> history('fileName.m') + +How do I submit a Pull Request (PR)? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Once you submit your contribution (menu option [3]), you will be +presented with a link that leads you directly to the pull request (PR). + +Print more detailed debugging information (verbose) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you encounter a problem, or suspect that something is not behaving +properly, please run: + +.. code:: matlab + + >> contribute(1) + +and follow the process as normally. This will set ``printLevel = 1``. +You can also set permanently ``gitConf.printLevel = 1;`` in +``assets/confDevTools.m``. + + +Technical questions +------------------- + I receive a ``Permission denied`` error. What can I do? -------------------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You may encounter the following error: @@ -26,7 +70,7 @@ generating the SSH key. Please leave the passphrase empty when generating the SSH key. Mismatch of the version of ``openSSL`` (Linux) ----------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You might be in the situation that you receive the following error: @@ -43,28 +87,8 @@ In that case, you should run the following command: where ```` corresponds to the installation of ``MATLAB``, e.g., ``/usr/local/MATLAB/R2016b`` -How do I submit a Pull Request (PR)? ------------------------------------- - -Once you submit your contribution (menu option [3]), you will be -presented with a link that leads you directly to the pull request (PR). - -Print more detailed debugging information (verbose) ---------------------------------------------------- - -If you encounter a problem, or suspect that something is not behaving -properly, please run: - -.. code:: matlab - - >> contribute(1) - -and follow the process as normally. This will set ``printLevel = 1``. -You can also set permanently ``gitConf.printLevel = 1;`` in -``assets/confDevTools.m``. - Resolve unexpected behavior - reset ------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you encounter unexpected behavior, please try to reset the ``MATLAB.devTools`` with: @@ -81,26 +105,9 @@ local fork (without re-cloning) again, type: >> resetLocalFork How can I abort a process? --------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^ You can abort any process using ``CTRL-C`` (hit ``CTRL`` and ``C`` on your keyboard). -How should I name my contribution? ----------------------------------- - -Initiate a contribution per theme/topic/feature/bug fix that you work -on. Don’t mix features and think of an explicit name, i.e. -``bug-fix-function1`` or ``add-tests-function2``. Avoid generic names, -such as ``my-great-feature`` or ``fix`` or ``contribution-myName``. - -How can I check the history of a file? --------------------------------------- - -You can check the history of a file by typing in MATLAB: - -.. code:: matlab - - >> history('fileName.m') - From a7da980a8c2a0fef6e2dbdc71fe1f828dfd9f047 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 30 Jan 2018 19:20:04 +0100 Subject: [PATCH 066/163] Changing title of contribute --- docs/source/contribute.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index d095ccb..508c5e5 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -1,7 +1,7 @@ .. _contribute: -Contribute to projects -====================== +How to configure and use +======================== The COBRA Toolbox From 8732e089dc96d54037937707c349fde252076818 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 30 Jan 2018 19:20:15 +0100 Subject: [PATCH 067/163] Adding description --- README.rst | 21 +++++++++++++++++++++ docs/source/index.rst | 3 +++ 2 files changed, 24 insertions(+) diff --git a/README.rst b/README.rst index 6bb0620..85d7b66 100644 --- a/README.rst +++ b/README.rst @@ -14,6 +14,27 @@ | |Build Status| | |Build Status| | |codecov| | |Code grade| | +----------------+----------------+---------------+--------------+ +.. begin-description-marker + +All repositories on Github are version controlled using `git +`__, a free and open-source distributed, version control +system, which tracks changes in computer files and is used for coordinating +work on those files by multiple people. + +In order to lower the technological barrier to the use of the popular software +development tool `git `__, we have developed +`MATLAB.devTools`, a new user-friendly software extension that enables +submission of new COBRA software and tutorials, in particular for `The COBRA +Toolbox `__ and the +`COBRA.tutorials `__. + +The `MATLAB.devTools `__ are +highly recommended for contributing code (in particular `MATLAB` code) to +existing repositories in a user-friendly and convenient way, even for those +without basic knowledge of `git`. + +.. end-description-marker + Pre-requisites -------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index 029aa23..200f4a8 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -21,6 +21,9 @@ MATLAB.devTools - Contribute the smart way View MATLAB.devTools source code on . +.. include:: ../../README.rst + :start-after: begin-description-marker + :end-before: end-description-marker .. include:: ../../README.rst :start-after: begin-intro-marker From 0b0e52cb6c370a757b9c2ad9f0ee581633bf8e3c Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 20:59:38 +0100 Subject: [PATCH 068/163] add icon to contribute --- docs/source/getstarted.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/getstarted.rst b/docs/source/getstarted.rst index 417d806..b69b1a8 100644 --- a/docs/source/getstarted.rst +++ b/docs/source/getstarted.rst @@ -5,3 +5,7 @@ How to get started :start-after: begin-getstarted-marker :end-before: end-getstarted-marker +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + From 14a4d3c38e65dccb271dbee1eaf125a5fbca7b88 Mon Sep 17 00:00:00 2001 From: Sylvain Arreckx Date: Tue, 30 Jan 2018 21:00:46 +0100 Subject: [PATCH 069/163] add icon to installation instructions --- docs/source/installation.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 96bdb11..36534d5 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -13,3 +13,7 @@ Installation :start-after: begin-installation-marker :end-before: end-installation-marker +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + From 6b166e92177d3993c4ab723df438011a9a13e432 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 08:28:42 +0100 Subject: [PATCH 070/163] Minor changes in text --- README.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 85d7b66..95e641c 100644 --- a/README.rst +++ b/README.rst @@ -163,9 +163,8 @@ How to cite the ``MATLAB.devTools`` .. begin-how-to-cite-marker -The ``MATLAB.devTools`` has been developped first for the COBRA Toolbox and -thus when citing the ``MATLAB.devTools``, one should refer to the following -paper: +As the ``MATLAB.devTools`` have first been developed for the COBRA Toolbox, the +paper of The COBRA Toolbox shall we cited when referring to the ``MATLAB.devTools``. Laurent Heirendt & Sylvain Arreckx, Thomas Pfau, Sebastian N. Mendoza, Anne Richelle, Almut Heinken, Hulda S. Haraldsdottir, Jacek From 3966b51c37ffef3af3448f40fd1e7cefb1c00d89 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 09:12:01 +0100 Subject: [PATCH 071/163] Adding troubleshooting section --- docs/source/contents.rst | 1 + docs/source/troubleshooting.rst | 5 +++++ docs/source/troubleshooting/cobratoolbox.rst | 2 ++ docs/source/troubleshooting/cobratutorials.rst | 2 ++ 4 files changed, 10 insertions(+) create mode 100644 docs/source/troubleshooting.rst create mode 100644 docs/source/troubleshooting/cobratoolbox.rst create mode 100644 docs/source/troubleshooting/cobratutorials.rst diff --git a/docs/source/contents.rst b/docs/source/contents.rst index 19f6c81..7da0986 100644 --- a/docs/source/contents.rst +++ b/docs/source/contents.rst @@ -10,5 +10,6 @@ MATLAB.devTools contribute modules/index faq + troubleshooting cite funding diff --git a/docs/source/troubleshooting.rst b/docs/source/troubleshooting.rst new file mode 100644 index 0000000..9bdc577 --- /dev/null +++ b/docs/source/troubleshooting.rst @@ -0,0 +1,5 @@ +Troubleshooting +=============== + +.. include:: troubleshooting/cobratoolbox.rst +.. include:: troubleshooting/cobratutorials.rst diff --git a/docs/source/troubleshooting/cobratoolbox.rst b/docs/source/troubleshooting/cobratoolbox.rst new file mode 100644 index 0000000..54687a0 --- /dev/null +++ b/docs/source/troubleshooting/cobratoolbox.rst @@ -0,0 +1,2 @@ +The COBRA Toolbox +^^^^^^^^^^^^^^^^^ diff --git a/docs/source/troubleshooting/cobratutorials.rst b/docs/source/troubleshooting/cobratutorials.rst new file mode 100644 index 0000000..8428ab4 --- /dev/null +++ b/docs/source/troubleshooting/cobratutorials.rst @@ -0,0 +1,2 @@ +COBRA.tutorials +^^^^^^^^^^^^^^^ From 3bad730e1a1fbde0ba6a35acb9908bdd00631b75 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 09:15:19 +0100 Subject: [PATCH 072/163] Draft of instructions for the CT --- docs/source/contribute.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index 508c5e5..baaacb1 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -13,6 +13,22 @@ The COBRA Toolbox :start-after: begin-screencast-marker :end-before: end-screencast-marker +A comprehensive code base such as the COBRA Toolbox evolves constantly. The +open-source community is very active, and collaborators submit their +contributions frequently. The more a new feature or bug fix is interlinked with +existing functions, the higher the risk of a new addition breaking instantly +code that is heavily used on a daily basis. In order to decrease this risk, a +continuous integration setup interlinked with the version control system git +has been set up. A git-tracked repository is essentially a folder with code or +other documents of which all incremental changes are tracked by date and user. + +Any incremental changes to the code are called commits. The main advantage of +git over other version control systems is the availability of branches. In +simple terms, a branch contains a sequence of incremental changes to the code. +A branch is also commonly referred to as a feature. Consequently, a +contribution generally consists of several commits on a branch. + + COBRA.tutorials --------------- From e2e4b17e6da9a958100d8d8f0f18a048e94f3ac4 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 09:48:58 +0100 Subject: [PATCH 073/163] Splitting up the contribute folder and adding instructions for the CT --- docs/source/contribute.rst | 33 +------------ docs/source/contribute/cobratoolbox.rst | 25 ++++++++++ docs/source/contribute/cobratutorials.rst | 6 +++ docs/source/troubleshooting/cobratoolbox.rst | 50 ++++++++++++++++++++ 4 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 docs/source/contribute/cobratoolbox.rst create mode 100644 docs/source/contribute/cobratutorials.rst diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index baaacb1..06eb36c 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -3,38 +3,9 @@ How to configure and use ======================== +.. include:: contribute/cobratoolbox.rst -The COBRA Toolbox ------------------ - -|asciicast| - -.. include:: ../../README.rst - :start-after: begin-screencast-marker - :end-before: end-screencast-marker - -A comprehensive code base such as the COBRA Toolbox evolves constantly. The -open-source community is very active, and collaborators submit their -contributions frequently. The more a new feature or bug fix is interlinked with -existing functions, the higher the risk of a new addition breaking instantly -code that is heavily used on a daily basis. In order to decrease this risk, a -continuous integration setup interlinked with the version control system git -has been set up. A git-tracked repository is essentially a folder with code or -other documents of which all incremental changes are tracked by date and user. - -Any incremental changes to the code are called commits. The main advantage of -git over other version control systems is the availability of branches. In -simple terms, a branch contains a sequence of incremental changes to the code. -A branch is also commonly referred to as a feature. Consequently, a -contribution generally consists of several commits on a branch. - - - -COBRA.tutorials ---------------- - -To come! - +.. include:: contribute/cobratutorials.rst Other repository ---------------- diff --git a/docs/source/contribute/cobratoolbox.rst b/docs/source/contribute/cobratoolbox.rst new file mode 100644 index 0000000..b539ae7 --- /dev/null +++ b/docs/source/contribute/cobratoolbox.rst @@ -0,0 +1,25 @@ +The COBRA Toolbox +----------------- + +|asciicast| + +.. include:: ../../README.rst + :start-after: begin-screencast-marker + :end-before: end-screencast-marker + +A comprehensive code base such as the COBRA Toolbox evolves constantly. The +open-source community is very active, and collaborators submit their +contributions frequently. The more a new feature or bug fix is interlinked with +existing functions, the higher the risk of a new addition breaking instantly +code that is heavily used on a daily basis. In order to decrease this risk, a +continuous integration setup interlinked with the version control system git +has been set up. A git-tracked repository is essentially a folder with code or +other documents of which all incremental changes are tracked by date and user. + +Any incremental changes to the code are called commits. The main advantage of +git over other version control systems is the availability of branches. In +simple terms, a branch contains a sequence of incremental changes to the code. +A branch is also commonly referred to as a feature. Consequently, a +contribution generally consists of several commits on a branch. + + diff --git a/docs/source/contribute/cobratutorials.rst b/docs/source/contribute/cobratutorials.rst new file mode 100644 index 0000000..330339d --- /dev/null +++ b/docs/source/contribute/cobratutorials.rst @@ -0,0 +1,6 @@ +COBRA.tutorials +--------------- + +To come! + + diff --git a/docs/source/troubleshooting/cobratoolbox.rst b/docs/source/troubleshooting/cobratoolbox.rst index 54687a0..df9b7cb 100644 --- a/docs/source/troubleshooting/cobratoolbox.rst +++ b/docs/source/troubleshooting/cobratoolbox.rst @@ -1,2 +1,52 @@ The COBRA Toolbox ^^^^^^^^^^^^^^^^^ + +|warning| This section is tailored to users who feel comfortable using +the terminal (or shell). It is recommended for other users +to follow `these instructions`__. + +|warning| A Github account is required and `git` must be installed. You also +must already have forked the `opencobra/cobratoolbox +`__ repository by clicking on +the fork button on the main `opencobra/cobratoolbox +`__ repository page. + +The repository of the COBRA Toolbox is version controlled with the open-source +standard `git` on the public code development site `github.com +`__. Any incremental change to the code is wrapped in a +commit, tagged with a specific tag (called SHA1), a commit message, and author +information, such as the email address and the user name. Contributions to the +COBRA Toolbox are consequently commits that are made on branches. + +The development scheme adopted in the repository of the COBRA Toolbox has two +branches: a `master` and a `develop` branch. The stable branch is the `master` +branch, while it is the `develop` branch that includes all new features and to +which new contributions are merged. Contributions are submitted for review and +testing through pull requests, the `git` standard. The `develop` branch is +regularly merged into the `master` branch once testing is concluded. + +The development scheme has been adopted for obvious reasons: the COBRA Toolbox +is heavily used on a daily basis, while the development community is active. +The key advantage of this setup is that developers can work on the next stable +release, while users can enjoy a stable version. Developers and users are +consequently working on the same code base without interfering. Understanding +the concept of branches is key to submitting hassle-free pull requests and +starting to contribute using `git`. + +|warning| + - The following commands should only be run from the terminal (or the shell). + - An SSH key must be set in your Github account settings. + + In order to get started, clone the forked repository: + +.. code:: console + + $ git clone git@github.com:/cobratoolbox.git fork-cobratoolbox + +This will create a folder called fork-cobratoolbox. Make sure to replace +`` with your Github username. Any of the following commands are meant +to be run from within the folder of the fork called `fork-cobratoolbox`. + +.. code:: console + + $ cd fork-cobratoolbox From 915e6de8cfb4dbb10455bdbed069577ff52afd36 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 10:46:21 +0100 Subject: [PATCH 074/163] Adding more content --- docs/source/troubleshooting/cobratoolbox.rst | 173 +++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/docs/source/troubleshooting/cobratoolbox.rst b/docs/source/troubleshooting/cobratoolbox.rst index df9b7cb..f3d13b5 100644 --- a/docs/source/troubleshooting/cobratoolbox.rst +++ b/docs/source/troubleshooting/cobratoolbox.rst @@ -1,6 +1,10 @@ The COBRA Toolbox ^^^^^^^^^^^^^^^^^ +.. |warning| raw:: html + + warning + |warning| This section is tailored to users who feel comfortable using the terminal (or shell). It is recommended for other users to follow `these instructions`__. @@ -11,6 +15,9 @@ must already have forked the `opencobra/cobratoolbox the fork button on the main `opencobra/cobratoolbox `__ repository page. +Development scheme +------------------ + The repository of the COBRA Toolbox is version controlled with the open-source standard `git` on the public code development site `github.com `__. Any incremental change to the code is wrapped in a @@ -33,6 +40,9 @@ consequently working on the same code base without interfering. Understanding the concept of branches is key to submitting hassle-free pull requests and starting to contribute using `git`. +Clone the fork and update the submodules +---------------------------------------- + |warning| - The following commands should only be run from the terminal (or the shell). - An SSH key must be set in your Github account settings. @@ -50,3 +60,166 @@ to be run from within the folder of the fork called `fork-cobratoolbox`. .. code:: console $ cd fork-cobratoolbox + +In order to complete the cloned repository with external code, it is +recommended to clone all submodules: + +.. code:: console + + $ git submodule update --init + +Configure the remotes +--------------------- + +Note that your fork is a copy of the `opencobra/cobratoolbox +`__ repository and is not +automatically updated. As such, you have to configure the address of the +`opencobra/cobratoolbox `__ +repository: + +.. code:: console + + $ git remote add upstream git@github.com:opencobra/cobratoolbox.git + +Now, there are two addresses (also called remotes) configured: `origin` and +`upstream`. You can verify this by typing: + +.. code:: console + + $ git remote -v + +In order to update your fork, run the following commands: + +.. code:: console + + $ git fetch upstream + +First, update the `master` branch: + +.. code:: console + + $ git checkout master # checkout the branch locally + $ git merge upstream/master # merge the changes from the upstream repository + $ git push origin master # push the changes to the branch of the fork + +Then, update the `develop` branch: + +.. code:: console + + $ git checkout develop # checkout the branch + $ git merge upstream/develop # merge the changes on the branch from the upstream repository + $ git push origin develop # push the changes to the branch of the fork + +|warning| Should the step fail to checkout the develop branch, you should +create the develop branch first based on the `develop` branch of the upstream +repository: + +.. code:: console + + $ git checkout -b develop upstream/develop + +Then, you can proceed normally. + +Create a contribution and submit a pull request +----------------------------------------------- + +Now, as the fork is up-to-date with the upstream repository, start a new +contribution. A new contribution must be made on a new branch, that originates +from the `develop` branch. Create the new branch: + +.. code:: console + + $ git checkout -b develop + +Now, you can make changes in the folder `fork-cobratoolbox`. Once you are done +making changes, you can contribute the files. An important command that lists +all changes is to retrieve the repository status: + +.. code:: console + + $ git status + +A list is displayed with new, modified, and deleted files. You can add the changes (even deletions) by +adding the file: + +.. code:: console + + $ git add . + +|warning| Contrary to what is sometimes provided as a shortcut, it is not +advised to add all files all at once using as this command will add all files, +even hidden files and binaries. + +.. code:: console + + $ git add . # bad practice + +Then, commit the changes by setting a commit message : + +.. code:: console + + $ git commit -m "" + +Finally, push your commit to Github: + +.. code:: console + + $ git push origin + +You should then see your commit online, and if ready, you can open a +pull request. You can select your branch in the dropdown menu and list all +commits by clicking on `commits`. + +Continue working on your branch after a while (rebase) +------------------------------------------------------ + +If there have been major changes or if you want to continue working on a branch +after a while, it is recommended to do a rebase. In simple terms, rebasing your +branch shifts your commits to the top of the branch and includes all changes +from the upstream repository. Before doing so, make sure that you do not have +any uncommitted or local changes (git status). + +.. code:: console + + $ git checkout develop + $ git fetch upstream + $ git merge upstream/develop $ git submodule update + $ git checkout + $ git rebase develop + +If you do not have any conflicts, you should see messages showing that your +changes have been applied. If however there are conflicts, it is advised to +use a merge tool such as `kdiff3`. In order to install a merge tool or abort +the rebase process, type: + +.. code:: console + + $ git rebase --abort + +In order to have the changes on `` reflected in the online +repository, push the changes with force. Pushing with force is required as the +history of the branch has been rewritten during rebase. + +.. code:: console + + $ git push --force + +Selectively use a commit on your branch (cherry-pick) +----------------------------------------------------- + +Imagine having two branches called `` and ``. On branch +`` is a commit with a SHA1 that you need on ``. You can +cherry-pick the commit from `` to `` by typing: + +.. code:: console + + $ git checkout myBranch-2 $ git cherry-pick SHA1 + +If there are no conflicts, the displayed message should contain the commit +message and author information. In order to have the commit listed online, +conclude the cherry-pick by pushing the commit to the remote repository: + +.. code:: console + + $ git push myBranch-2 + From d8f8d126298bd507be0cf65fa3122e9747ffd544 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 10:57:18 +0100 Subject: [PATCH 075/163] Minor changes --- docs/source/troubleshooting/cobratoolbox.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/source/troubleshooting/cobratoolbox.rst b/docs/source/troubleshooting/cobratoolbox.rst index f3d13b5..ce5869c 100644 --- a/docs/source/troubleshooting/cobratoolbox.rst +++ b/docs/source/troubleshooting/cobratoolbox.rst @@ -7,7 +7,7 @@ The COBRA Toolbox |warning| This section is tailored to users who feel comfortable using the terminal (or shell). It is recommended for other users -to follow `these instructions`__. +to follow :ref:`these instructions `. |warning| A Github account is required and `git` must be installed. You also must already have forked the `opencobra/cobratoolbox @@ -19,7 +19,7 @@ Development scheme ------------------ The repository of the COBRA Toolbox is version controlled with the open-source -standard `git` on the public code development site `github.com +standard ``git`` on the public code development site `github.com `__. Any incremental change to the code is wrapped in a commit, tagged with a specific tag (called SHA1), a commit message, and author information, such as the email address and the user name. Contributions to the @@ -43,7 +43,8 @@ starting to contribute using `git`. Clone the fork and update the submodules ---------------------------------------- -|warning| +|warning| Please note the following: + - The following commands should only be run from the terminal (or the shell). - An SSH key must be set in your Github account settings. @@ -183,7 +184,8 @@ any uncommitted or local changes (git status). $ git checkout develop $ git fetch upstream - $ git merge upstream/develop $ git submodule update + $ git merge upstream/develop + $ git submodule update $ git checkout $ git rebase develop @@ -213,7 +215,8 @@ cherry-pick the commit from `` to `` by typing: .. code:: console - $ git checkout myBranch-2 $ git cherry-pick SHA1 + $ git checkout myBranch-2 + $ git cherry-pick SHA1 If there are no conflicts, the displayed message should contain the commit message and author information. In order to have the commit listed online, From 59bb7c8f6d70d5fb1c0388055ed9d5421a3943ae Mon Sep 17 00:00:00 2001 From: jennifer modamio Date: Tue, 30 Jan 2018 14:56:13 +0100 Subject: [PATCH 076/163] Draft of instructions to contribute --- instructions.rst | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 instructions.rst diff --git a/instructions.rst b/instructions.rst new file mode 100644 index 0000000..90e5b73 --- /dev/null +++ b/instructions.rst @@ -0,0 +1,47 @@ +Contribute a new tutorial or make change to an existing one +=========================================================== + +Fork and checkout your branch +----------------------------- + +1. Fork the repository `https://www.github.com/opencobra/COBRA.tutorials`_ on Github +2. Clone the forked repository to a directory of your choice: +```bash +$ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git +``` +3. Change to the directory: +```bash +$ cd fork-COBRA.tutorials.git/ +``` +4. Set the upstream to the `opencobra/COBRA.tutorials` repository: +```bash +$ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git +``` +5. Fetch from the upstream repository +```bash +$ git fetch upstream +``` +6. Checkout a new branch from `develop`: +```bash +$ git checkout -b upstream/develop +``` +7. Now, make your changes in the tutorial in MATLAB. + +Submit your changes and open a pull request +------------------------------------------- +Once you are done making changes, add the files to your branch: +```bash +$ git add tutorial_.m +$ git add tutorial_.mlx +$ git commit -m "Changes to tutorial_" +``` +where `tutorial_` is the name of the tutorial. Make sure to add the `.m` and the `.mlx` files. +8. Push your commits on `` to your fork: +```bash +$ git push origin +``` +9. Browse to your fork on `https://www.github.com//COBRA.tutorials`_, where `` is your Github username. +10. Click on `Compare & Pull Request` +11. Change the target branch `develop` +11. Submit your pull request +12. Wait until your pull request is accepted From 65b8da9a426981f89d0dc5a9204ec84c11cfeb96 Mon Sep 17 00:00:00 2001 From: jennifer modamio Date: Tue, 30 Jan 2018 14:59:33 +0100 Subject: [PATCH 077/163] Formatting Formatting (1) Formatting (2) Formatting (3) Formatting (4) Formatting (5) Formatting (6) --- instructions.rst | 66 ++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/instructions.rst b/instructions.rst index 90e5b73..9a0f835 100644 --- a/instructions.rst +++ b/instructions.rst @@ -1,46 +1,52 @@ -Contribute a new tutorial or make change to an existing one -=========================================================== +Contribute a new tutorial +========================= Fork and checkout your branch ----------------------------- -1. Fork the repository `https://www.github.com/opencobra/COBRA.tutorials`_ on Github +1. Fork the repository `https://www.github.com/opencobra/COBRA.tutorials` on Github. 2. Clone the forked repository to a directory of your choice: -```bash -$ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git -``` + .. code-block:: console + + $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git + 3. Change to the directory: -```bash -$ cd fork-COBRA.tutorials.git/ -``` + .. code-block:: console + + $ cd fork-COBRA.tutorials.git/ + 4. Set the upstream to the `opencobra/COBRA.tutorials` repository: -```bash -$ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git -``` + .. code-block:: console + + $ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git + 5. Fetch from the upstream repository -```bash -$ git fetch upstream -``` + .. code-block:: console + + $ git fetch upstream + 6. Checkout a new branch from `develop`: -```bash -$ git checkout -b upstream/develop -``` + .. code-block:: console + + $ git checkout -b upstream/develop + 7. Now, make your changes in the tutorial in MATLAB. Submit your changes and open a pull request ------------------------------------------- -Once you are done making changes, add the files to your branch: -```bash -$ git add tutorial_.m -$ git add tutorial_.mlx -$ git commit -m "Changes to tutorial_" -``` -where `tutorial_` is the name of the tutorial. Make sure to add the `.m` and the `.mlx` files. -8. Push your commits on `` to your fork: -```bash -$ git push origin -``` -9. Browse to your fork on `https://www.github.com//COBRA.tutorials`_, where `` is your Github username. +8. Once you are done making changes, add the files to your branch, where `tutorial_` is the name of the tutorial. Make sure to add the `.m` and the `.mlx` files. + .. code-block:: console + + $ git add tutorial_.m + $ git add tutorial_.mlx + $ git commit -m "Changes to tutorial_" + +9. Push your commits on `` to your fork: + .. code-block:: console + + $ git push origin + +9. Browse to your fork on `https://www.github.com//COBRA.tutorials`, where `` is your Github username. 10. Click on `Compare & Pull Request` 11. Change the target branch `develop` 11. Submit your pull request From a01cf8f315eccdb7ce5ab22dfafe68989f0373a1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 30 Jan 2018 21:09:39 +0100 Subject: [PATCH 078/163] Adjust RST markup --- instructions.rst | 62 +++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/instructions.rst b/instructions.rst index 9a0f835..a3cdaca 100644 --- a/instructions.rst +++ b/instructions.rst @@ -4,50 +4,64 @@ Contribute a new tutorial Fork and checkout your branch ----------------------------- -1. Fork the repository `https://www.github.com/opencobra/COBRA.tutorials` on Github. +1. Fork the repository ``https://www.github.com/opencobra/COBRA.tutorials`` on Github. + 2. Clone the forked repository to a directory of your choice: - .. code-block:: console + + .. code-block:: console - $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git + $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git 3. Change to the directory: + .. code-block:: console $ cd fork-COBRA.tutorials.git/ -4. Set the upstream to the `opencobra/COBRA.tutorials` repository: - .. code-block:: console +4. Set the upstream to the ``opencobra/COBRA.tutorials`` repository: + + .. code-block:: console - $ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git + $ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git 5. Fetch from the upstream repository - .. code-block:: console + + .. code-block:: console - $ git fetch upstream + $ git fetch upstream -6. Checkout a new branch from `develop`: - .. code-block:: console +6. Checkout a new branch from ``develop``: + + .. code-block:: console - $ git checkout -b upstream/develop + $ git checkout -b upstream/develop 7. Now, make your changes in the tutorial in MATLAB. + Submit your changes and open a pull request ------------------------------------------- -8. Once you are done making changes, add the files to your branch, where `tutorial_` is the name of the tutorial. Make sure to add the `.m` and the `.mlx` files. - .. code-block:: console - $ git add tutorial_.m - $ git add tutorial_.mlx - $ git commit -m "Changes to tutorial_" +8. Once you are done making changes, add the files to your branch, where ``tutorial_`` is the name of the tutorial. Make sure to add the ``.m`` and the ``.mlx`` files. -9. Push your commits on `` to your fork: - .. code-block:: console + .. code-block:: console + + $ git add tutorial_.m + $ git add tutorial_.mlx + $ git commit -m "Changes to tutorial_" + +9. Push your commits on ```` to your fork: + + .. code-block:: console + + $ git push origin + +9. Browse to your fork on ``https://www.github.com//COBRA.tutorials``, where ```` is your Github username. + +10. Click on ``Compare & Pull Request``. + +11. Change the target branch ``develop``. - $ git push origin +11. Submit your pull request. -9. Browse to your fork on `https://www.github.com//COBRA.tutorials`, where `` is your Github username. -10. Click on `Compare & Pull Request` -11. Change the target branch `develop` -11. Submit your pull request -12. Wait until your pull request is accepted +12. Wait until your pull request is accepted. From 561d3b12b968f9cde704c43ee8698f431cde92cb Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 30 Jan 2018 21:12:11 +0100 Subject: [PATCH 079/163] Fix numbering --- instructions.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instructions.rst b/instructions.rst index a3cdaca..6baec7f 100644 --- a/instructions.rst +++ b/instructions.rst @@ -14,9 +14,9 @@ Fork and checkout your branch 3. Change to the directory: - .. code-block:: console + .. code-block:: console - $ cd fork-COBRA.tutorials.git/ + $ cd fork-COBRA.tutorials.git/ 4. Set the upstream to the ``opencobra/COBRA.tutorials`` repository: @@ -56,12 +56,12 @@ Submit your changes and open a pull request $ git push origin -9. Browse to your fork on ``https://www.github.com//COBRA.tutorials``, where ```` is your Github username. +10. Browse to your fork on ``https://www.github.com//COBRA.tutorials``, where ```` is your Github username. -10. Click on ``Compare & Pull Request``. +11. Click on ``Compare & Pull Request``. -11. Change the target branch ``develop``. +12. Change the target branch ``develop``. -11. Submit your pull request. +13. Submit your pull request. -12. Wait until your pull request is accepted. +14. Wait until your pull request is accepted. From f046a398cb64bd06dd63953976359d3fbda8c9c0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:04:09 +0100 Subject: [PATCH 080/163] Moving instructions for cobra tutorials --- .../source/troubleshooting/cobratutorials.rst | 69 ++++++++++++++++++- instructions.rst | 67 ------------------ 2 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 instructions.rst diff --git a/docs/source/troubleshooting/cobratutorials.rst b/docs/source/troubleshooting/cobratutorials.rst index 8428ab4..6baec7f 100644 --- a/docs/source/troubleshooting/cobratutorials.rst +++ b/docs/source/troubleshooting/cobratutorials.rst @@ -1,2 +1,67 @@ -COBRA.tutorials -^^^^^^^^^^^^^^^ +Contribute a new tutorial +========================= + +Fork and checkout your branch +----------------------------- + +1. Fork the repository ``https://www.github.com/opencobra/COBRA.tutorials`` on Github. + +2. Clone the forked repository to a directory of your choice: + + .. code-block:: console + + $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git + +3. Change to the directory: + + .. code-block:: console + + $ cd fork-COBRA.tutorials.git/ + +4. Set the upstream to the ``opencobra/COBRA.tutorials`` repository: + + .. code-block:: console + + $ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git + +5. Fetch from the upstream repository + + .. code-block:: console + + $ git fetch upstream + +6. Checkout a new branch from ``develop``: + + .. code-block:: console + + $ git checkout -b upstream/develop + +7. Now, make your changes in the tutorial in MATLAB. + + +Submit your changes and open a pull request +------------------------------------------- + +8. Once you are done making changes, add the files to your branch, where ``tutorial_`` is the name of the tutorial. Make sure to add the ``.m`` and the ``.mlx`` files. + + .. code-block:: console + + $ git add tutorial_.m + $ git add tutorial_.mlx + $ git commit -m "Changes to tutorial_" + +9. Push your commits on ```` to your fork: + + .. code-block:: console + + $ git push origin + +10. Browse to your fork on ``https://www.github.com//COBRA.tutorials``, where ```` is your Github username. + +11. Click on ``Compare & Pull Request``. + +12. Change the target branch ``develop``. + +13. Submit your pull request. + +14. Wait until your pull request is accepted. diff --git a/instructions.rst b/instructions.rst deleted file mode 100644 index 6baec7f..0000000 --- a/instructions.rst +++ /dev/null @@ -1,67 +0,0 @@ -Contribute a new tutorial -========================= - -Fork and checkout your branch ------------------------------ - -1. Fork the repository ``https://www.github.com/opencobra/COBRA.tutorials`` on Github. - -2. Clone the forked repository to a directory of your choice: - - .. code-block:: console - - $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git - -3. Change to the directory: - - .. code-block:: console - - $ cd fork-COBRA.tutorials.git/ - -4. Set the upstream to the ``opencobra/COBRA.tutorials`` repository: - - .. code-block:: console - - $ git remote add upstream git@github.com:opencobra/COBRA.tutorials.git - -5. Fetch from the upstream repository - - .. code-block:: console - - $ git fetch upstream - -6. Checkout a new branch from ``develop``: - - .. code-block:: console - - $ git checkout -b upstream/develop - -7. Now, make your changes in the tutorial in MATLAB. - - -Submit your changes and open a pull request -------------------------------------------- - -8. Once you are done making changes, add the files to your branch, where ``tutorial_`` is the name of the tutorial. Make sure to add the ``.m`` and the ``.mlx`` files. - - .. code-block:: console - - $ git add tutorial_.m - $ git add tutorial_.mlx - $ git commit -m "Changes to tutorial_" - -9. Push your commits on ```` to your fork: - - .. code-block:: console - - $ git push origin - -10. Browse to your fork on ``https://www.github.com//COBRA.tutorials``, where ```` is your Github username. - -11. Click on ``Compare & Pull Request``. - -12. Change the target branch ``develop``. - -13. Submit your pull request. - -14. Wait until your pull request is accepted. From d641da6192f00255732a8f76b357f2b05924c489 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:21:08 +0100 Subject: [PATCH 081/163] Minor changes to formatting --- .../source/troubleshooting/cobratutorials.rst | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/source/troubleshooting/cobratutorials.rst b/docs/source/troubleshooting/cobratutorials.rst index 6baec7f..5228e45 100644 --- a/docs/source/troubleshooting/cobratutorials.rst +++ b/docs/source/troubleshooting/cobratutorials.rst @@ -1,18 +1,29 @@ -Contribute a new tutorial -========================= +COBRA.tutorials +^^^^^^^^^^^^^^^ + +.. |warning| raw:: html + + warning + +|warning| This section is tailored to users who feel comfortable using +the terminal (or shell). It is recommended for other users +to follow :ref:`these instructions `. + +|warning| A Github account is required and `git` must be installed. An SSH key +must be set as explained in :ref:`prerequisites`. Fork and checkout your branch ----------------------------- -1. Fork the repository ``https://www.github.com/opencobra/COBRA.tutorials`` on Github. +1. Fork the `COBRA.tutorials repository `__ on Github. -2. Clone the forked repository to a directory of your choice: +2. Clone the forked repository to ``fork-COBRA.tutorials`` located in a directory of your choice: .. code-block:: console $ git clone git@github.com:/COBRA.tutorials.git fork-COBRA.tutorials.git -3. Change to the directory: +3. Change to the directory ``fork-COBRA.tutorials``: .. code-block:: console From 9900d1bb41df91fd1b0b781e39f442626684c76f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:31:58 +0100 Subject: [PATCH 082/163] Reorganization for new content in contribute --- docs/source/contribute.rst | 12 +----------- docs/source/contribute/cobratoolbox.rst | 16 +++++++++++++++- docs/source/contribute/cobratutorials.rst | 4 ++-- docs/source/contribute/otherrepo.rst | 11 +++++++++++ 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 docs/source/contribute/otherrepo.rst diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index 06eb36c..8fbfd1b 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -7,14 +7,4 @@ How to configure and use .. include:: contribute/cobratutorials.rst -Other repository ----------------- - -.. include:: ../../README.rst - :start-after: begin-contribute-other-repo-marker - :end-before: end-contribute-other-repo-marker - -.. include:: ../../README.rst - :start-after: begin-icon-marker - :end-before: end-icon-marker - +.. include:: contribute/otherrepo.rst diff --git a/docs/source/contribute/cobratoolbox.rst b/docs/source/contribute/cobratoolbox.rst index b539ae7..79cd0d8 100644 --- a/docs/source/contribute/cobratoolbox.rst +++ b/docs/source/contribute/cobratoolbox.rst @@ -1,5 +1,5 @@ The COBRA Toolbox ------------------ +^^^^^^^^^^^^^^^^^ |asciicast| @@ -7,6 +7,9 @@ The COBRA Toolbox :start-after: begin-screencast-marker :end-before: end-screencast-marker +Introduction +------------ + A comprehensive code base such as the COBRA Toolbox evolves constantly. The open-source community is very active, and collaborators submit their contributions frequently. The more a new feature or bug fix is interlinked with @@ -22,4 +25,15 @@ simple terms, a branch contains a sequence of incremental changes to the code. A branch is also commonly referred to as a feature. Consequently, a contribution generally consists of several commits on a branch. +Contributing to the COBRA Toolbox is straightforward. As a contributor to the +COBRA Toolbox is likely more familiar with MATLAB than with the internal +mechanics of git, the `MATLAB.devTools` have been developed specifically +to contribute to a git-tracked repository located on the Github server. In +Figure 6, an overview of the two online repositories as well as their local +copies is given. There are two ways of using the COBRA Toolbox, which depends +on the type of user. A regular user might only want to use the opencobra +repository and enjoy stability (option A), whereas more advanced users might +want to develop their own features and actively make contributions to the +opencobra repository (option B). + diff --git a/docs/source/contribute/cobratutorials.rst b/docs/source/contribute/cobratutorials.rst index 330339d..f0874a2 100644 --- a/docs/source/contribute/cobratutorials.rst +++ b/docs/source/contribute/cobratutorials.rst @@ -1,6 +1,6 @@ COBRA.tutorials ---------------- +^^^^^^^^^^^^^^^ -To come! +Coming soon. diff --git a/docs/source/contribute/otherrepo.rst b/docs/source/contribute/otherrepo.rst new file mode 100644 index 0000000..18d0643 --- /dev/null +++ b/docs/source/contribute/otherrepo.rst @@ -0,0 +1,11 @@ +Other repository +^^^^^^^^^^^^^^^^ + +.. include:: ../../README.rst + :start-after: begin-contribute-other-repo-marker + :end-before: end-contribute-other-repo-marker + +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + From 366e5d9f135a1f4940f1424bbfaef71ac419487c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:46:32 +0100 Subject: [PATCH 083/163] Adding image --- docs/source/contribute/cobratoolbox.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/source/contribute/cobratoolbox.rst b/docs/source/contribute/cobratoolbox.rst index 79cd0d8..e2cf727 100644 --- a/docs/source/contribute/cobratoolbox.rst +++ b/docs/source/contribute/cobratoolbox.rst @@ -36,4 +36,7 @@ repository and enjoy stability (option A), whereas more advanced users might want to develop their own features and actively make contributions to the opencobra repository (option B). +|branchModel| + +.. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png From 10e8f1f5caf705340e0cdace35d86262d2b30de0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:46:40 +0100 Subject: [PATCH 084/163] Minor changes --- docs/source/prerequisites.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/prerequisites.rst b/docs/source/prerequisites.rst index f0b637c..b252317 100644 --- a/docs/source/prerequisites.rst +++ b/docs/source/prerequisites.rst @@ -11,7 +11,7 @@ to use the ``MATLAB.devTools`` on. - **Check if you already have an SSH key:** -:: +.. code:: console $ ls -al ~/.ssh @@ -23,7 +23,7 @@ key. Now, you have to **add your SSH key to Github**. More help is SSH key (see previous step), you have to generate one (more help is `here `__): -:: +.. code:: console $ ssh-keygen -t rsa -C "first.last@server.com" From 7cdf31990f933f78a3f790c894bee71dab4bc082 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 11:56:12 +0100 Subject: [PATCH 085/163] Adding content for the CT --- docs/source/contribute/cobratoolbox.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/source/contribute/cobratoolbox.rst b/docs/source/contribute/cobratoolbox.rst index e2cf727..380f5e7 100644 --- a/docs/source/contribute/cobratoolbox.rst +++ b/docs/source/contribute/cobratoolbox.rst @@ -38,5 +38,26 @@ opencobra repository (option B). |branchModel| + - **Option A** The `opencobra/cobratoolbox `_ repository is a + public repository that is read-only. Once the opencobra repository has been + installed in the folder `cobratoolbox`, all branches + (including ``master`` and ``develop``) are available locally. In the local directory + `cobratoolbox` folder, the user has read and write access, but cannot push eventual + changes back to the opencobra repository. It is the default and stable ``master`` + branch only that should be used. The local copy located in the cobratoolbox + directory can be updated (both branches). + + - **Option B** In order to make changes to the + opencobra repository, or, in other words, contribute, you must obtain your own + personal copy first. You must register on the `Github website `_ in order to obtain a username. First, click on the button FORK at the top + right corner of the official `opencobra/cobratoolbox `_ repository website + in order to create a personal copy + (or fork) with write and read access of the opencobra repository. This copy is + accessible under `https://github.com//cobratoolbox`, where `` is + your Github username. In the + `fork-cobratoolbox` folder, other user specific branches may exist in addition to + the ``master`` and ``develop`` branches. + .. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png + From 2595c326bfa04785465fbbc287d01b62aaceb384 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:05:29 +0100 Subject: [PATCH 086/163] Renaming contributing content --- .../{contribute/cobratoolbox.rst => contr_cobratoolbox.rst} | 0 .../{contribute/cobratutorials.rst => contr_cobratutorials.rst} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename docs/source/{contribute/cobratoolbox.rst => contr_cobratoolbox.rst} (100%) rename docs/source/{contribute/cobratutorials.rst => contr_cobratutorials.rst} (100%) diff --git a/docs/source/contribute/cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst similarity index 100% rename from docs/source/contribute/cobratoolbox.rst rename to docs/source/contr_cobratoolbox.rst diff --git a/docs/source/contribute/cobratutorials.rst b/docs/source/contr_cobratutorials.rst similarity index 100% rename from docs/source/contribute/cobratutorials.rst rename to docs/source/contr_cobratutorials.rst From 8082c92cfea876a7cc3b6c98a1e502d5f6b32939 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:06:01 +0100 Subject: [PATCH 087/163] Fixing include --- docs/source/contr_cobratoolbox.rst | 8 +++++++- docs/source/contribute.rst | 7 ++----- docs/source/contribute/otherrepo.rst | 4 ++-- docs/source/index.rst | 4 ---- docs/source/prerequisites.rst | 2 -- docs/source/troubleshooting.rst | 2 ++ 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/source/contr_cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst index 380f5e7..7d67373 100644 --- a/docs/source/contr_cobratoolbox.rst +++ b/docs/source/contr_cobratoolbox.rst @@ -58,6 +58,12 @@ opencobra repository (option B). `fork-cobratoolbox` folder, other user specific branches may exist in addition to the ``master`` and ``develop`` branches. -.. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png +After initialisation of the MATLAB.devTools, the user and developer may have two +folders: a ``cobratoolbox`` folder with the stable ``master`` branch checked out, and a +``fork-cobratoolbox`` folder with the ``develop`` branch checked out. Detailed +instructions for troubleshooting and/or contributing to the COBRA Toolbox using +the terminal (or shell) are provided :ref:`here `. + +.. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index 8fbfd1b..0a9fe92 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -3,8 +3,5 @@ How to configure and use ======================== -.. include:: contribute/cobratoolbox.rst - -.. include:: contribute/cobratutorials.rst - -.. include:: contribute/otherrepo.rst +.. include:: contr_cobratoolbox.rst +.. include:: contr_cobratutorials.rst diff --git a/docs/source/contribute/otherrepo.rst b/docs/source/contribute/otherrepo.rst index 18d0643..fcc4881 100644 --- a/docs/source/contribute/otherrepo.rst +++ b/docs/source/contribute/otherrepo.rst @@ -1,11 +1,11 @@ Other repository ^^^^^^^^^^^^^^^^ -.. include:: ../../README.rst +.. include:: ../../../README.rst :start-after: begin-contribute-other-repo-marker :end-before: end-contribute-other-repo-marker -.. include:: ../../README.rst +.. include:: ../../../README.rst :start-after: begin-icon-marker :end-before: end-icon-marker diff --git a/docs/source/index.rst b/docs/source/index.rst index 200f4a8..11386cb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -25,7 +25,3 @@ MATLAB.devTools - Contribute the smart way :start-after: begin-description-marker :end-before: end-description-marker -.. include:: ../../README.rst - :start-after: begin-intro-marker - :end-before: end-intro-marker - diff --git a/docs/source/prerequisites.rst b/docs/source/prerequisites.rst index b252317..0cbc046 100644 --- a/docs/source/prerequisites.rst +++ b/docs/source/prerequisites.rst @@ -1,5 +1,3 @@ -.. _prerequisites: - Pre-requisites -------------- diff --git a/docs/source/troubleshooting.rst b/docs/source/troubleshooting.rst index 9bdc577..17eb424 100644 --- a/docs/source/troubleshooting.rst +++ b/docs/source/troubleshooting.rst @@ -1,3 +1,5 @@ +.. _troubleshooting: + Troubleshooting =============== From f55b5eb0cb6d99948a78307b50a11ff7852b75ef Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:33:39 +0100 Subject: [PATCH 088/163] Adding content to the CT --- docs/source/contr_cobratoolbox.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/contr_cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst index 7d67373..bd53603 100644 --- a/docs/source/contr_cobratoolbox.rst +++ b/docs/source/contr_cobratoolbox.rst @@ -64,6 +64,20 @@ folders: a ``cobratoolbox`` folder with the stable ``master`` branch checked out instructions for troubleshooting and/or contributing to the COBRA Toolbox using the terminal (or shell) are provided :ref:`here `. +After the official opencobra version of the COBRA Toolbox has been installed, +it is possible to install the MATLAB.devTools from within MATLAB: + +.. code:: console + + >> installDevTools + +With this command, the directory MATLAB.devTools is created next to the +cobratoolbox installation directory. The MATLAB.devTools can also be installed +from the terminal (or shell): + +.. code:: console + + $ git clone git@github.com:openCOBRA/MATLAB.devTools .. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png From 4419934d68a91fb8bd8a4c2b762c401e2760c284 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:48:32 +0100 Subject: [PATCH 089/163] Movin contributing guidelines for other repo --- docs/source/{contribute/otherrepo.rst => contr_otherrepo.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/source/{contribute/otherrepo.rst => contr_otherrepo.rst} (100%) diff --git a/docs/source/contribute/otherrepo.rst b/docs/source/contr_otherrepo.rst similarity index 100% rename from docs/source/contribute/otherrepo.rst rename to docs/source/contr_otherrepo.rst From aa1e6ae52cfc0e8e2c934237631cc3d0e66b21df Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:48:44 +0100 Subject: [PATCH 090/163] Fix for icons --- README.rst | 4 ++++ docs/source/contr_cobratoolbox.rst | 23 ++++++++++++++++++++ docs/source/contr_otherrepo.rst | 4 ++-- docs/source/contribute.rst | 1 + docs/source/prerequisites.rst | 3 +++ docs/source/troubleshooting/cobratoolbox.rst | 4 ---- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 95e641c..821f095 100644 --- a/README.rst +++ b/README.rst @@ -226,4 +226,8 @@ paper of The COBRA Toolbox shall we cited when referring to the ``MATLAB.devTool bulb +.. |warning| raw:: html + + warning + .. end-icon-marker diff --git a/docs/source/contr_cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst index bd53603..b7eb61a 100644 --- a/docs/source/contr_cobratoolbox.rst +++ b/docs/source/contr_cobratoolbox.rst @@ -79,5 +79,28 @@ from the terminal (or shell): $ git clone git@github.com:openCOBRA/MATLAB.devTools +|warning| A working internet connection is required and git and curl must be +installed. Installation instructions are provided on the main repository page +of the MATLAB.devTools. A valid passphrase-less SSH key must be set in the +Github account settings in order to contribute without entering a password +while securely communicating with the Github server. + +The MATLAB.devTools are configured on the fly or whenever the configuration +details are not present. The first time a user runs contribute, the personal +repository (fork) is downloaded (cloned) into a new folder named +`fork-cobratoolbox` at the location specified by the user. In this local folder, +both ``master`` and ``develop`` branches exist, but it is the ``develop`` branch that is +automatically selected (checked out). Any new contributions are derived from +the develop branch. Initialising a contribution using the MATLAB.devTools is +straightforward. In MATLAB, type: + +.. code:: matlab + + >> contribute % then select procedure [1] + .. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + diff --git a/docs/source/contr_otherrepo.rst b/docs/source/contr_otherrepo.rst index fcc4881..18d0643 100644 --- a/docs/source/contr_otherrepo.rst +++ b/docs/source/contr_otherrepo.rst @@ -1,11 +1,11 @@ Other repository ^^^^^^^^^^^^^^^^ -.. include:: ../../../README.rst +.. include:: ../../README.rst :start-after: begin-contribute-other-repo-marker :end-before: end-contribute-other-repo-marker -.. include:: ../../../README.rst +.. include:: ../../README.rst :start-after: begin-icon-marker :end-before: end-icon-marker diff --git a/docs/source/contribute.rst b/docs/source/contribute.rst index 0a9fe92..945d50d 100644 --- a/docs/source/contribute.rst +++ b/docs/source/contribute.rst @@ -5,3 +5,4 @@ How to configure and use .. include:: contr_cobratoolbox.rst .. include:: contr_cobratutorials.rst +.. include:: contr_otherrepo.rst diff --git a/docs/source/prerequisites.rst b/docs/source/prerequisites.rst index 0cbc046..cd32dbb 100644 --- a/docs/source/prerequisites.rst +++ b/docs/source/prerequisites.rst @@ -128,4 +128,7 @@ with your respective credentials. .. |windows1| image:: https://prince.lcsb.uni.lu/img/installation_git_windows_1.png :width: 280px +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker diff --git a/docs/source/troubleshooting/cobratoolbox.rst b/docs/source/troubleshooting/cobratoolbox.rst index ce5869c..ff51612 100644 --- a/docs/source/troubleshooting/cobratoolbox.rst +++ b/docs/source/troubleshooting/cobratoolbox.rst @@ -1,10 +1,6 @@ The COBRA Toolbox ^^^^^^^^^^^^^^^^^ -.. |warning| raw:: html - - warning - |warning| This section is tailored to users who feel comfortable using the terminal (or shell). It is recommended for other users to follow :ref:`these instructions `. From 6789bdd7b53cd8213bd816b6069cf454634eb5eb Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 15:51:17 +0100 Subject: [PATCH 091/163] Fix for icons in getstarted --- docs/source/getstarted.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/getstarted.rst b/docs/source/getstarted.rst index 417d806..b69b1a8 100644 --- a/docs/source/getstarted.rst +++ b/docs/source/getstarted.rst @@ -5,3 +5,7 @@ How to get started :start-after: begin-getstarted-marker :end-before: end-getstarted-marker +.. include:: ../../README.rst + :start-after: begin-icon-marker + :end-before: end-icon-marker + From 57fb45ec3747a3c07ae8682105d48fd7c2cbe384 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 31 Jan 2018 16:38:07 +0100 Subject: [PATCH 092/163] Additional content for CT --- docs/source/contr_cobratoolbox.rst | 107 +++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/docs/source/contr_cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst index b7eb61a..ed14d55 100644 --- a/docs/source/contr_cobratoolbox.rst +++ b/docs/source/contr_cobratoolbox.rst @@ -85,6 +85,9 @@ of the MATLAB.devTools. A valid passphrase-less SSH key must be set in the Github account settings in order to contribute without entering a password while securely communicating with the Github server. +Start a new contribution +------------------------ + The MATLAB.devTools are configured on the fly or whenever the configuration details are not present. The first time a user runs contribute, the personal repository (fork) is downloaded (cloned) into a new folder named @@ -98,6 +101,110 @@ straightforward. In MATLAB, type: >> contribute % then select procedure [1] +If the MATLAB.devTools are already configured, procedure [1] updates the fork +(if necessary) and initialises a new branch with a name requested during the +process. Once the contribution is initialised, files can be added, modified or +deleted in the `fork-cobratoolbox` folder. A contribution is successfully +initialised when the user is presented with a brief summary of configuration +details. Instructions on how to proceed are also provided. + +|warning| The location of the fork must be specified as the root directory. +There will be a warning issued if the path already contains another git-tracked +repository. + +Continue an existing contribution +--------------------------------- + +An existing contribution can be continued after a while. This step is +particularly important in order to retrieve all changes that have been made to +the opencobra repository in the meantime. + +.. code:: matlab + + >> contribute % then select procedure [2] + +Procedure ``[2]`` pulls all changes from the opencobra repository, and rebases the +existing contribution. In other words, existing commits are shifted forward and +placed after all commits made on the develop branch of the opencobra +repository. + +|warning| Before attempting to continue working on an existing +feature, make sure that you published your commits. + +Publish a contribution +----------------------- + +Publishing a contribution means uploading the incremental code changes to the +fork. The changes are available in public, but not yet available in the +opencobra repository. A contribution may only be accepted in the official +repository once a pull request has been submitted. It is not necessary to open +a pull request if you want to simply upload your contribution to your fork. + +.. code:: matlab + + >> contribute % then select procedure [3] + +When running procedure ``[3]``, you have two options: + +- **Option A** Simple contribution without opening a pull request: All changes + to the code are individually listed and the user is asked explicitly which + changes shall be added to the commit. Once all changes have been added, a + commit message must be entered. Upon confirmation, the changes are pushed to + the online fork automatically. + +- **Option B** Publishing and opening a pull request: The procedure for + submitting a pull request is the same as option (A) with the difference that + when selecting to open a pull request, a link is provided that leads to a + pre-configured website according to the contributing guidelines. The pull + request is then one click away. + +|warning| After following procedures ``[1]`` and ``[2]``, all changes should be +published using procedure ``[3]`` before stopping to work on that contribution. +When following procedure ``[3]``, the incremental changes are uploaded to the +remote server. It is advised to publish often, and make small incremental +changes to the code. There is no need for opening a pull request immediately +(option **A**) if there are more changes to be made. A pull request may be opened +at any time, even manually directly from the Github website. + +Deleting a contribution +----------------------- + +If a contribution has been merged into the develop branch of the opencobra +repository (accepted pull request), the contribution (feature or branch) can be +safely deleted both locally and remotely on the fork by running contribute and +selecting procedure ``[4]``. + +Note that deleting a contribution deletes all the changes that have been made +on that feature (branch). It is not possible to selectively delete a commit +using the MATLAB.devTools. Instead, create a new branch by following procedure +``[1]``, and follow the instructions to cherry-pick (see +:ref:`troubleshooting`). + +|warning| Make sure that your changes are either merged or saved locally if you +need them. Once procedure ``[4]`` is concluded, all changes on the deleted +branch are removed, both locally and remotely. No commits can be recovered. + +Update your fork +---------------- + +It is sometimes useful to simply update the fork without starting a new +contribution. The local fork can be updated using procedure ``[5]`` of the +contribute menu. + +.. code:: matlab + + >> contribute % then select procedure [5] + +Before updating your fork, make sure that no changes are present in the local +directory `fork-cobratoolbox`. You can do so by typing: + +.. code:: matlab + + >> checkStatus + +If there are changes listed, publish them by selecting procedure ``[3]`` of the +contribute menu. + .. |branchModel| image:: https://prince.lcsb.uni.lu/img/figure6.png .. include:: ../../README.rst From 5a701da706af7be194fc09ffa9c5e584c59f04f6 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 1 Feb 2018 14:33:44 +0100 Subject: [PATCH 093/163] Adding github key to known hosts --- src/checkSystem.m | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/checkSystem.m b/src/checkSystem.m index 31a4970..ab436d0 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -52,9 +52,42 @@ function checkSystem(callerName) if status_curl == 0 && ~isempty(strfind(result_curl, 'curl')) && ~isempty(strfind(result_curl, 'http')) printMsg(mfilename, [callerName, ' curl is properly installed.']); else + fprintf(result_curl); error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); end + % add github.com as a known host + [status_keyscan, result_keyscan] = system('ssh-keyscan'); + + % user directory + if ispc + homeDir = getenv('userprofile'); + else + homeDir = getenv('HOME'); + end + + if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) + + [status_grep, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + if status_grep == 1 && length(result_grep) == 0 + [status_kh, result_kh] = system(['ssh-keyscan github.com >> ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + if status_kh == 0 + printMsg(mfilename, [callerName, ' github.com has been added to the known hosts']); + else + fprintf(result_kh); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); + end + else + fprintf(result_grep); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' Known hosts cannot be determined.']); + end + else + fprintf(result_keyscan); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' ssh-keyscan is not installed.']); + end + if printLevel > 0 gitConf.printLevel = gitConfprintLevel; end From 2460f5b6f116a6b1f27799d46d1028851c598cb6 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 1 Feb 2018 14:41:41 +0100 Subject: [PATCH 094/163] Fix for checkSystem --- src/checkSystem.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index ab436d0..224c428 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -68,9 +68,9 @@ function checkSystem(callerName) if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) - [status_grep, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + [~, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); - if status_grep == 1 && length(result_grep) == 0 + if strcmp(result_grep, '') [status_kh, result_kh] = system(['ssh-keyscan github.com >> ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); if status_kh == 0 @@ -79,10 +79,9 @@ function checkSystem(callerName) fprintf(result_kh); error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); end - else - fprintf(result_grep); - error([gitCmd.lead, ' [', mfilename, ']', callerName, ' Known hosts cannot be determined.']); - end + else + printMsg(mfilename, [callerName, ' github.com is already a known host.']); + end else fprintf(result_keyscan); error([gitCmd.lead, ' [', mfilename, ']', callerName, ' ssh-keyscan is not installed.']); From e2dcc0039036fb828e775079eb9a2a60d2b56dee Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 1 Feb 2018 14:46:33 +0100 Subject: [PATCH 095/163] Touching known hosts file first --- src/checkSystem.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/checkSystem.m b/src/checkSystem.m index 224c428..da51f8c 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -68,6 +68,10 @@ function checkSystem(callerName) if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) + % touch the file first + system(['touch ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + % read the known hosts file [~, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); if strcmp(result_grep, '') From 1627cc20ecf49b3e51f14e72ba9ec2a219044d8f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 5 Feb 2018 15:53:16 +0100 Subject: [PATCH 096/163] Draft function of adding key to known host --- src/addKeyToKnownHosts.m | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/addKeyToKnownHosts.m diff --git a/src/addKeyToKnownHosts.m b/src/addKeyToKnownHosts.m new file mode 100644 index 0000000..1731075 --- /dev/null +++ b/src/addKeyToKnownHosts.m @@ -0,0 +1,62 @@ +function keyAdded = addKeyToKnownHosts(callerName) +% Checks if the public key to `site.ext` exists +% If the public key of the `site.ext` does not exist, +% adds the public key to the known hosts +% +% USAGE: +% +% keyAdded = addKeyToKnownHosts(callerName) +% +% INPUT: +% callerName: Name of the function calling (default: empty string) +% +% OUTPUT: +% keyAdded: Boolean (true if key has been added successfully or exists) +% +% .. Author: +% - Laurent Heirendt + + global gitCmd + + % set default arguments + if ~exist('callerName', 'var') + callerName = ''; + end + + % add github.com as a known host + [status_keyscan, result_keyscan] = system('ssh-keyscan'); + + % user directory + if ispc + homeDir = getenv('userprofile'); + else + homeDir = getenv('HOME'); + end + + if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) + + % touch the file first + system(['touch ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + % read the known hosts file + [~, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + if strcmp(result_grep, '') + [status_kh, result_kh] = system(['ssh-keyscan github.com >> ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); + + if status_kh == 0 && ~isempty(strfind(result_kh, '# github.com')) + printMsg(mfilename, [callerName, ' github.com has been added to the known hosts']); + keyAdded = true; + else + fprintf(result_kh); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); + end + else + printMsg(mfilename, [callerName, ' github.com is already a known host.']); + keyAdded = true; + end + else + fprintf(result_keyscan); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' ssh-keyscan is not installed.']); + end +end From b830d1726ace9bead2fdca301a2260180af0644b Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 5 Feb 2018 15:56:44 +0100 Subject: [PATCH 097/163] Adding host key to checkSystem --- src/checkSystem.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/checkSystem.m b/src/checkSystem.m index da51f8c..cf4ed49 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -15,6 +15,9 @@ function checkSystem(callerName) global gitConf global gitCmd + % add the public key from github.com to the known hosts + addKeyToKnownHosts(); + % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) confDevTools(); From 2990187c1f25f655949cad2aff5f884b921d5629 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 5 Feb 2018 16:01:16 +0100 Subject: [PATCH 098/163] Removing code as moved to external function --- src/checkSystem.m | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index cf4ed49..428fb8f 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -59,41 +59,6 @@ function checkSystem(callerName) error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); end - % add github.com as a known host - [status_keyscan, result_keyscan] = system('ssh-keyscan'); - - % user directory - if ispc - homeDir = getenv('userprofile'); - else - homeDir = getenv('HOME'); - end - - if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) - - % touch the file first - system(['touch ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); - - % read the known hosts file - [~, result_grep] = system(['grep "^github.com " ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); - - if strcmp(result_grep, '') - [status_kh, result_kh] = system(['ssh-keyscan github.com >> ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); - - if status_kh == 0 - printMsg(mfilename, [callerName, ' github.com has been added to the known hosts']); - else - fprintf(result_kh); - error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); - end - else - printMsg(mfilename, [callerName, ' github.com is already a known host.']); - end - else - fprintf(result_keyscan); - error([gitCmd.lead, ' [', mfilename, ']', callerName, ' ssh-keyscan is not installed.']); - end - if printLevel > 0 gitConf.printLevel = gitConfprintLevel; end From 3e5021ea50114c7a8fc3822d1bea617bff1a7e0c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 5 Feb 2018 17:58:25 +0100 Subject: [PATCH 099/163] Draft of configuration for project --- src/confDevToolsForProject.m | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/confDevToolsForProject.m diff --git a/src/confDevToolsForProject.m b/src/confDevToolsForProject.m new file mode 100644 index 0000000..7019c73 --- /dev/null +++ b/src/confDevToolsForProject.m @@ -0,0 +1,37 @@ +function confDevToolsForProject(projectName) +% devTools +% +% INPUT: +% projectName: Name of the project (default: 'cobratoolbox') +% PURPOSE: define the configuration of the devTools +% +% Note: +% Currently, only 2 projects are defined: +% - cobratoolbox: https://www.github.com/opencobra/cobratoolbox +% - COBRA.tutorials: https://www.github.com/opencobra/COBRA.tutorials +% +% .. Author: +% - Laurent Heirendt, January 2018 + + global gitConf + global gitCmd + + % check if a project name has been specified + if ~exist('projectName', 'var') + projectName = 'cobratoolbox'; + end + + if strcmp(projectName, 'cobratoolbox') % configure the devTools for https://www.github.com/opencobra/cobratoolbox + confDevTools(); + + % print out a success message + printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); + + elseif strcmp(projectName, 'COBRA.tutorials') % configure the devTools for https://www.github.com/opencobra/COBRA.tutorials + % print out a success message + printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); + + else + error('You have to specify a project name that is pre-configured or configure the devTools manually.'); + end + From 76e4b5c53a3a58d62d275ddd578faf56ed6825dd Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 6 Feb 2018 22:51:45 +0100 Subject: [PATCH 100/163] Fix for printing a message when devTools not initialized --- src/printMsg.m | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/printMsg.m b/src/printMsg.m index 876b392..dbd4ce4 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -15,11 +15,20 @@ function printMsg(fileName, msg, endMsg) global gitConf global gitCmd - if nargin < 3 - endMsg = [gitCmd.success, gitCmd.trail]; - end + % define the message + if ~isempty(gitConf) && ~isempty(gitCmd) + % define the end of the message + if nargin < 3 + endMsg = [gitCmd.success, gitCmd.trail]; + end - if gitConf.printLevel > 0 - fprintf([gitCmd.lead, ' [', fileName, '] ', msg, endMsg]); + if gitConf.printLevel > 0 + message = [gitCmd.lead, ' [', fileName, '] ', msg, endMsg]; + end + else + message = [' [', fileName, '] ', msg]; end + + % print the message properly speaking + fprintf(message); end From c2215cab1513886cc300c8e3cebbcfc57d5bd102 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 6 Feb 2018 23:02:34 +0100 Subject: [PATCH 101/163] Fixing bug --- src/printMsg.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/printMsg.m b/src/printMsg.m index dbd4ce4..d658970 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -23,12 +23,9 @@ function printMsg(fileName, msg, endMsg) end if gitConf.printLevel > 0 - message = [gitCmd.lead, ' [', fileName, '] ', msg, endMsg]; + fprintf([gitCmd.lead, ' [', fileName, '] ', msg, endMsg]); end else - message = [' [', fileName, '] ', msg]; + fprintf([' [', fileName, '] ', msg]); end - - % print the message properly speaking - fprintf(message); end From 051d51749d081f90f9b2a97f1c7dcee4ea567294 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 7 Feb 2018 11:35:59 +0100 Subject: [PATCH 102/163] Testing to create the ssh directory --- src/addKeyToKnownHosts.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/addKeyToKnownHosts.m b/src/addKeyToKnownHosts.m index 1731075..79f0862 100644 --- a/src/addKeyToKnownHosts.m +++ b/src/addKeyToKnownHosts.m @@ -35,6 +35,9 @@ if status_keyscan == 1 && ~isempty(strfind(result_keyscan, 'usage:')) + % try to create the directory + [status_createDir, ~, ~] = mkdir([homeDir filesep '.ssh']); + % touch the file first system(['touch ', homeDir, filesep, '.ssh', filesep, 'known_hosts']); From b2e049273b5a14f992782ee4e8788ce9dae66002 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 8 Feb 2018 06:24:03 +0100 Subject: [PATCH 103/163] Configuration of devtools for tutorials --- src/confDevTools.m | 11 ++++++++--- src/confDevToolsForProject.m | 9 +++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index 5e0a71f..c1934b1 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -11,18 +11,23 @@ function confDevTools(launcher, remoteRepoURL, nickName, printLevel) gitConf.leadForkDirName = 'fork-'; gitConf.exampleBranch = 'add-constraints'; - if nargin < 4 % default values - gitConf.printLevel = 0; + if ~exist('printLevel', 'var') + printLevel = 1; + end + + if nargin < 3 % default values gitConf.launcher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; gitConf.remoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; gitConf.nickName = 'cobratoolbox'; else - gitConf.printLevel = printLevel; gitConf.launcher = launcher; gitConf.remoteRepoURL = remoteRepoURL; gitConf.nickName = nickName; end + % define the printLevel + gitConf.printLevel = printLevel; + % define the URL of the devTools gitConf.devToolsURL_SSH = 'git@github.com:opencobra/MATLAB.devTools.git'; gitConf.devToolsURL_HTTPS = 'https://github.com/opencobra/MATLAB.devTools.git'; diff --git a/src/confDevToolsForProject.m b/src/confDevToolsForProject.m index 7019c73..80574dc 100644 --- a/src/confDevToolsForProject.m +++ b/src/confDevToolsForProject.m @@ -28,6 +28,15 @@ function confDevToolsForProject(projectName) printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); elseif strcmp(projectName, 'COBRA.tutorials') % configure the devTools for https://www.github.com/opencobra/COBRA.tutorials + + % configure the repository + launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; + remoteRepoURL = 'https://github.com/opencobra/COBRA.tutorials.git'; + nickName = 'COBRA.tutorials'; + + % sets the configuration + confDevTools(launcher, remoteRepoURL, nickName); + % print out a success message printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); From 2630137ef8c3e7dbe9632fc265ac3e12d5ef12ea Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 8 Feb 2018 07:31:41 +0100 Subject: [PATCH 104/163] Removing confDevToolsForProject --- src/confDevToolsForProject.m | 46 ------------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 src/confDevToolsForProject.m diff --git a/src/confDevToolsForProject.m b/src/confDevToolsForProject.m deleted file mode 100644 index 80574dc..0000000 --- a/src/confDevToolsForProject.m +++ /dev/null @@ -1,46 +0,0 @@ -function confDevToolsForProject(projectName) -% devTools -% -% INPUT: -% projectName: Name of the project (default: 'cobratoolbox') -% PURPOSE: define the configuration of the devTools -% -% Note: -% Currently, only 2 projects are defined: -% - cobratoolbox: https://www.github.com/opencobra/cobratoolbox -% - COBRA.tutorials: https://www.github.com/opencobra/COBRA.tutorials -% -% .. Author: -% - Laurent Heirendt, January 2018 - - global gitConf - global gitCmd - - % check if a project name has been specified - if ~exist('projectName', 'var') - projectName = 'cobratoolbox'; - end - - if strcmp(projectName, 'cobratoolbox') % configure the devTools for https://www.github.com/opencobra/cobratoolbox - confDevTools(); - - % print out a success message - printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); - - elseif strcmp(projectName, 'COBRA.tutorials') % configure the devTools for https://www.github.com/opencobra/COBRA.tutorials - - % configure the repository - launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; - remoteRepoURL = 'https://github.com/opencobra/COBRA.tutorials.git'; - nickName = 'COBRA.tutorials'; - - % sets the configuration - confDevTools(launcher, remoteRepoURL, nickName); - - % print out a success message - printMsg(mfilename, [' The devTools have been configured for ', projectName, '.']); - - else - error('You have to specify a project name that is pre-configured or configure the devTools manually.'); - end - From f19bf7e917d9973834a10f048926f321a71d35e3 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 8 Feb 2018 07:34:37 +0100 Subject: [PATCH 105/163] Rewriting of confDevTools --- src/checkSystem.m | 3 +- src/confDevTools.m | 75 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 16 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 31a4970..7eff168 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -19,7 +19,8 @@ function checkSystem(callerName) if isempty(gitConf) confDevTools(); else - confDevTools(gitConf.launcher, gitConf.remoteRepoURL, gitConf.nickName, gitConf.printLevel); + confDevTools('launcher', gitConf.launcher, 'remoteRepoURL', ... + gitConf.remoteRepoURL, 'nickName', gitConf.nickName, 'printLevel', gitConf.printLevel); end % set the callerName diff --git a/src/confDevTools.m b/src/confDevTools.m index c1934b1..78af980 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -1,32 +1,75 @@ -function confDevTools(launcher, remoteRepoURL, nickName, printLevel) -% devTools +function confDevTools(varargin) +% Configure the devTools by defining the `gitConf` object % -% PURPOSE: define the configuration of the devTools +% INPUT: +% repoName: Name of the repository (default: 'cobratoolbox') +% launcher: String with a header to be displayed when starting +% nickName: Short name of the repository +% printLevel: Verbose level (default: 1) +% remoteRepoURL: URL of the repository +% +% Note: +% Currently, only 2 projects are defined: +% - cobratoolbox: https://www.github.com/opencobra/cobratoolbox +% - COBRA.tutorials: https://www.github.com/opencobra/COBRA.tutorials +% +% .. Author: +% - Laurent Heirendt, January 2018 % global gitConf global gitCmd - % definition of parameters - gitConf.leadForkDirName = 'fork-'; - gitConf.exampleBranch = 'add-constraints'; + % define default values + defaultRepoName = 'cobratoolbox'; + defaultLauncher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; + defaultRemoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; + defaultNickName = 'cobratoolbox'; + defaultPrintLevel = 1; + + % setup the parser + parser = inputParser(); + parser.addParamValue('repoName', defaultRepoName, @(x) ischar(x) && ~isempty(x)); + parser.addParamValue('launcher', defaultLauncher, @ischar); + parser.addParamValue('nickName', defaultNickName, @(x) ischar(x) && ~isempty(x)); + parser.addParamValue('printLevel', defaultPrintLevel, @(x) isnumeric(x)); + parser.addParamValue('remoteRepoURL', defaultRemoteRepoURL, @(x) ischar(x) && ~isempty(x)); - if ~exist('printLevel', 'var') - printLevel = 1; + % parse the input arguments + if ~isempty(varargin) + parser.parse(varargin{:}); + else + parser.parse(); end - if nargin < 3 % default values - gitConf.launcher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; - gitConf.remoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; - gitConf.nickName = 'cobratoolbox'; + % retrieve the variables + repoName = parser.Results.repoName; + + % define the configuration of other projects here + if strcmpi(repoName, 'COBRA.tutorials') + launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; + remoteRepoURL = 'https://github.com/opencobra/COBRA.tutorials.git'; + nickName = 'COBRA.tutorials'; + printLevel = parser.Results.printLevel; else - gitConf.launcher = launcher; - gitConf.remoteRepoURL = remoteRepoURL; - gitConf.nickName = nickName; + launcher = parser.Results.launcher; + remoteRepoURL = parser.Results.remoteRepoURL; + nickName = parser.Results.nickName; + printLevel = parser.Results.printLevel; + if printLevel > 0 + fprintf([' -- Assuming the default configuration (', nickName, ' repository)\n']); + end end + % definition of parameters + gitConf.leadForkDirName = 'fork-'; + gitConf.exampleBranch = 'add-constraints'; + % define the printLevel gitConf.printLevel = printLevel; + gitConf.launcher = launcher; + gitConf.remoteRepoURL = remoteRepoURL; + gitConf.nickName = nickName; % define the URL of the devTools gitConf.devToolsURL_SSH = 'git@github.com:opencobra/MATLAB.devTools.git'; @@ -39,4 +82,6 @@ function confDevTools(launcher, remoteRepoURL, nickName, printLevel) gitCmd.fail = ' (Error) '; gitCmd.trail = '\n'; + % print out a success message + printMsg(mfilename, [' The devTools have been configured (', nickName, ').']); end From 8c9a4da14a663032509067e8d2afc00648b1963b Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 8 Feb 2018 07:45:26 +0100 Subject: [PATCH 106/163] New syntax in test --- test/testCheckSystem.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testCheckSystem.m b/test/testCheckSystem.m index 4b62c67..626c458 100644 --- a/test/testCheckSystem.m +++ b/test/testCheckSystem.m @@ -11,7 +11,8 @@ resetDevTools(); % set the configuration -confDevTools(launcher, remoteRepoURL, nickName, printLevel); +confDevTools('launcher', launcher, 'remoteRepoURL', remoteRepoURL, ... + 'nickName', nickName, 'printLevel', printLevel); % check the system checkSystem(); From 6c9de0baef4ebbd7a33dce37879f4b3c26ff2fd6 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 14 Feb 2018 17:31:43 +0100 Subject: [PATCH 107/163] Changes after review --- src/checkSystem.m | 7 ++++--- src/confDevTools.m | 23 ++++++++++++++--------- test/testCheckSystem.m | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 7eff168..347d117 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -17,10 +17,11 @@ function checkSystem(callerName) % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) - confDevTools(); + % default configuration of the devTools is the opencobra/cobratoolbox repository + confDevTools('opencobra/cobratoolbox'); else - confDevTools('launcher', gitConf.launcher, 'remoteRepoURL', ... - gitConf.remoteRepoURL, 'nickName', gitConf.nickName, 'printLevel', gitConf.printLevel); + confDevTools(gitConf.nickName, gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... + 'printLevel', gitConf.printLevel); end % set the callerName diff --git a/src/confDevTools.m b/src/confDevTools.m index 78af980..7bf5b14 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -1,12 +1,18 @@ -function confDevTools(varargin) +function confDevTools(repoName, varargin) % Configure the devTools by defining the `gitConf` object % -% INPUT: +% USAGE: +% +% confDevTools(repoName, remoteRepoURL, varargin) +% +% INPUTS: % repoName: Name of the repository (default: 'cobratoolbox') +% +% OPTIONAL INPUTS: +% remoteRepoURL: URL of the repository % launcher: String with a header to be displayed when starting % nickName: Short name of the repository % printLevel: Verbose level (default: 1) -% remoteRepoURL: URL of the repository % % Note: % Currently, only 2 projects are defined: @@ -21,7 +27,6 @@ function confDevTools(varargin) global gitCmd % define default values - defaultRepoName = 'cobratoolbox'; defaultLauncher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; defaultRemoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; defaultNickName = 'cobratoolbox'; @@ -29,15 +34,15 @@ function confDevTools(varargin) % setup the parser parser = inputParser(); - parser.addParamValue('repoName', defaultRepoName, @(x) ischar(x) && ~isempty(x)); + parser.addRequired('repoName', @ischar); + parser.addOptional('remoteRepoURL', ['https://github.com/' repoName '.git'], @ischar); parser.addParamValue('launcher', defaultLauncher, @ischar); - parser.addParamValue('nickName', defaultNickName, @(x) ischar(x) && ~isempty(x)); + parser.addParamValue('nickName', repoName, @ischar); parser.addParamValue('printLevel', defaultPrintLevel, @(x) isnumeric(x)); - parser.addParamValue('remoteRepoURL', defaultRemoteRepoURL, @(x) ischar(x) && ~isempty(x)); % parse the input arguments if ~isempty(varargin) - parser.parse(varargin{:}); + parser.parse(repoName, varargin{:}); else parser.parse(); end @@ -46,7 +51,7 @@ function confDevTools(varargin) repoName = parser.Results.repoName; % define the configuration of other projects here - if strcmpi(repoName, 'COBRA.tutorials') + if strcmpi(repoName, 'opencobra/COBRA.tutorials') launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; remoteRepoURL = 'https://github.com/opencobra/COBRA.tutorials.git'; nickName = 'COBRA.tutorials'; diff --git a/test/testCheckSystem.m b/test/testCheckSystem.m index 626c458..77b2c27 100644 --- a/test/testCheckSystem.m +++ b/test/testCheckSystem.m @@ -11,7 +11,7 @@ resetDevTools(); % set the configuration -confDevTools('launcher', launcher, 'remoteRepoURL', remoteRepoURL, ... +confDevTools(nickName, remoteRepoURL, 'launcher', launcher, ... 'nickName', nickName, 'printLevel', printLevel); % check the system From 452b850f3a0fe6733f54071e09034e64920c53fe Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 14 Feb 2018 17:37:22 +0100 Subject: [PATCH 108/163] Fix for bug --- src/confDevTools.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index 7bf5b14..b3b9e65 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -44,7 +44,7 @@ function confDevTools(repoName, varargin) if ~isempty(varargin) parser.parse(repoName, varargin{:}); else - parser.parse(); + parser.parse(repoName); end % retrieve the variables From e8d6b5a21a15e386961bb33e5ba11552fd52f9a5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 14 Feb 2018 18:10:34 +0100 Subject: [PATCH 109/163] Minor changes --- src/confDevTools.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index b3b9e65..ab10829 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -37,7 +37,7 @@ function confDevTools(repoName, varargin) parser.addRequired('repoName', @ischar); parser.addOptional('remoteRepoURL', ['https://github.com/' repoName '.git'], @ischar); parser.addParamValue('launcher', defaultLauncher, @ischar); - parser.addParamValue('nickName', repoName, @ischar); + parser.addParamValue('nickName', regexprep(repoName,'[^a-zA-Z0-9]',''), @ischar); parser.addParamValue('printLevel', defaultPrintLevel, @(x) isnumeric(x)); % parse the input arguments @@ -49,18 +49,16 @@ function confDevTools(repoName, varargin) % retrieve the variables repoName = parser.Results.repoName; + nickName = parser.Results.nickName; + printLevel = parser.Results.printLevel; % define the configuration of other projects here if strcmpi(repoName, 'opencobra/COBRA.tutorials') launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; - remoteRepoURL = 'https://github.com/opencobra/COBRA.tutorials.git'; nickName = 'COBRA.tutorials'; - printLevel = parser.Results.printLevel; else launcher = parser.Results.launcher; remoteRepoURL = parser.Results.remoteRepoURL; - nickName = parser.Results.nickName; - printLevel = parser.Results.printLevel; if printLevel > 0 fprintf([' -- Assuming the default configuration (', nickName, ' repository)\n']); end From 3dfa7515e96b70082aab8614d15bc2441938837a Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 14 Feb 2018 18:22:57 +0100 Subject: [PATCH 110/163] Fix for remoteRepoURL --- src/confDevTools.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index ab10829..d5ebdec 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -51,6 +51,7 @@ function confDevTools(repoName, varargin) repoName = parser.Results.repoName; nickName = parser.Results.nickName; printLevel = parser.Results.printLevel; + remoteRepoURL = parser.Results.remoteRepoURL; % define the configuration of other projects here if strcmpi(repoName, 'opencobra/COBRA.tutorials') @@ -58,7 +59,6 @@ function confDevTools(repoName, varargin) nickName = 'COBRA.tutorials'; else launcher = parser.Results.launcher; - remoteRepoURL = parser.Results.remoteRepoURL; if printLevel > 0 fprintf([' -- Assuming the default configuration (', nickName, ' repository)\n']); end From 9ba81e7049698df85bbc918094eb5e3f41ca0911 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 14 Feb 2018 16:59:50 +0100 Subject: [PATCH 111/163] Oncleanup break --- contribute.m | 4 ++++ src/initDevTools.m | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/contribute.m b/contribute.m index 93d1916..b3e5fe7 100644 --- a/contribute.m +++ b/contribute.m @@ -45,6 +45,8 @@ function contribute(printLevel) choice = input('\n (You can abort any process using CTRL-C)\n\n [1] Start a new feature (branch).\n [2] Select an existing feature (branch) to work on.\n [3] Publish a feature (branch).\n [4] Delete a feature (branch).\n [5] Update the fork.\n\n -> Please select what you want to do (enter the number): ', 's'); + finishup = onCleanup(@() resetDevTools()); + choice = str2num(choice); if length(choice) == 0 || choice > 5 || choice < 0 @@ -135,4 +137,6 @@ function contribute(printLevel) % change back to the current directory cd(currentDir); + + finishup = onCleanup(@() resetDevTools()); end diff --git a/src/initDevTools.m b/src/initDevTools.m index b80ddd5..9ddbe2c 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -8,8 +8,6 @@ function initDevTools() % .. Author: % - Laurent Heirendt - - global gitConf global gitCmd @@ -185,4 +183,7 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Local directory : ', gitConf.fullForkDir, gitCmd.trail]) fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); + + finishup = onCleanup(@() resetDevTools()); + end From e6d449d27649a063bc46fdc5c9a90ad911d1892f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 10:35:35 +0100 Subject: [PATCH 112/163] Adding cleanup functions to beginning of fcts --- contribute.m | 5 ++--- src/addKeyToKnownHosts.m | 2 +- src/initDevTools.m | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/contribute.m b/contribute.m index b3e5fe7..7ccf659 100644 --- a/contribute.m +++ b/contribute.m @@ -22,6 +22,8 @@ function contribute(printLevel) % adding the src folder of the devTools addpath(genpath(fileparts(which(mfilename)))); + finishup = onCleanup(@() resetDevTools()); + % check the system and set the configuration checkSystem(mfilename); @@ -45,8 +47,6 @@ function contribute(printLevel) choice = input('\n (You can abort any process using CTRL-C)\n\n [1] Start a new feature (branch).\n [2] Select an existing feature (branch) to work on.\n [3] Publish a feature (branch).\n [4] Delete a feature (branch).\n [5] Update the fork.\n\n -> Please select what you want to do (enter the number): ', 's'); - finishup = onCleanup(@() resetDevTools()); - choice = str2num(choice); if length(choice) == 0 || choice > 5 || choice < 0 @@ -138,5 +138,4 @@ function contribute(printLevel) % change back to the current directory cd(currentDir); - finishup = onCleanup(@() resetDevTools()); end diff --git a/src/addKeyToKnownHosts.m b/src/addKeyToKnownHosts.m index 79f0862..4062182 100644 --- a/src/addKeyToKnownHosts.m +++ b/src/addKeyToKnownHosts.m @@ -55,7 +55,7 @@ error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); end else - printMsg(mfilename, [callerName, ' github.com is already a known host.']); + printMsg(mfilename, [callerName, ' github.com is already a known host.\n']); keyAdded = true; end else diff --git a/src/initDevTools.m b/src/initDevTools.m index 9ddbe2c..0ed43bd 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -11,6 +11,8 @@ function initDevTools() global gitConf global gitCmd + finishup = onCleanup(@() resetDevTools()); + % check the system and set the configuration checkSystem(mfilename); @@ -183,7 +185,4 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Local directory : ', gitConf.fullForkDir, gitCmd.trail]) fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); - - finishup = onCleanup(@() resetDevTools()); - end From bc39143483fcf341ef972cfb87b229ed8c8b39f5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 11:11:00 +0100 Subject: [PATCH 113/163] Resetting the onCleanup action --- contribute.m | 3 +++ src/initDevTools.m | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/contribute.m b/contribute.m index 7ccf659..96a5ab5 100644 --- a/contribute.m +++ b/contribute.m @@ -138,4 +138,7 @@ function contribute(printLevel) % change back to the current directory cd(currentDir); + % reset the onCleanup action + finishup = onCleanup(); + end diff --git a/src/initDevTools.m b/src/initDevTools.m index 0ed43bd..7841d8f 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -185,4 +185,8 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Local directory : ', gitConf.fullForkDir, gitCmd.trail]) fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); + + % reset the onCleanup action + finishup = onCleanup(); + end From cec6845e85711487e8915df5ec74fc3a61751b8e Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 11:14:09 +0100 Subject: [PATCH 114/163] Define an empty onCleanup action --- contribute.m | 2 +- src/initDevTools.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contribute.m b/contribute.m index 96a5ab5..a1f7a21 100644 --- a/contribute.m +++ b/contribute.m @@ -139,6 +139,6 @@ function contribute(printLevel) cd(currentDir); % reset the onCleanup action - finishup = onCleanup(); + finishup = onCleanup(@() fprintf('')); end diff --git a/src/initDevTools.m b/src/initDevTools.m index 7841d8f..1cb3522 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -187,6 +187,6 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); % reset the onCleanup action - finishup = onCleanup(); + finishup = onCleanup(@() fprintf('')); end From d87fc49995feb018ca61b9b411c0fcc9d5f3fb86 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 11:40:18 +0100 Subject: [PATCH 115/163] Corrected retrieval of nickname --- src/confDevTools.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index d5ebdec..28b8041 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -37,7 +37,7 @@ function confDevTools(repoName, varargin) parser.addRequired('repoName', @ischar); parser.addOptional('remoteRepoURL', ['https://github.com/' repoName '.git'], @ischar); parser.addParamValue('launcher', defaultLauncher, @ischar); - parser.addParamValue('nickName', regexprep(repoName,'[^a-zA-Z0-9]',''), @ischar); + parser.addParamValue('nickName', defaultNickName, @ischar); parser.addParamValue('printLevel', defaultPrintLevel, @(x) isnumeric(x)); % parse the input arguments @@ -49,9 +49,13 @@ function confDevTools(repoName, varargin) % retrieve the variables repoName = parser.Results.repoName; - nickName = parser.Results.nickName; - printLevel = parser.Results.printLevel; remoteRepoURL = parser.Results.remoteRepoURL; + printLevel = parser.Results.printLevel; + + % set the default nickName + urlSplit = strsplit(remoteRepoURL, '/'); + tmpNickName = strsplit(urlSplit{end}, '.git'); + nickName = tmpNickName{1}; % define the configuration of other projects here if strcmpi(repoName, 'opencobra/COBRA.tutorials') From bb1d3085765d31d75de875530d80e95493fe1d21 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 12:26:54 +0100 Subject: [PATCH 116/163] Introduction of resetDevToolsFlag for onCleanup --- contribute.m | 10 ++++++---- src/initDevTools.m | 6 ++++-- src/resetDevTools.m | 42 +++++++++++++++++++++++------------------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/contribute.m b/contribute.m index a1f7a21..495c6ba 100644 --- a/contribute.m +++ b/contribute.m @@ -15,6 +15,9 @@ function contribute(printLevel) global gitConf global gitCmd + global resetDevToolsFlag + + resetDevToolsFlag = true; % retrieve the current directory currentDir = pwd; @@ -22,7 +25,7 @@ function contribute(printLevel) % adding the src folder of the devTools addpath(genpath(fileparts(which(mfilename)))); - finishup = onCleanup(@() resetDevTools()); + finishup = onCleanup(@() resetDevTools()) % check the system and set the configuration checkSystem(mfilename); @@ -135,10 +138,9 @@ function contribute(printLevel) end end + resetDevToolsFlag = false; + % change back to the current directory cd(currentDir); - % reset the onCleanup action - finishup = onCleanup(@() fprintf('')); - end diff --git a/src/initDevTools.m b/src/initDevTools.m index 1cb3522..6025e52 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -10,6 +10,9 @@ function initDevTools() global gitConf global gitCmd + global resetDevToolsFlag + + resetDevToolsFlag = true; finishup = onCleanup(@() resetDevTools()); @@ -186,7 +189,6 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); - % reset the onCleanup action - finishup = onCleanup(@() fprintf('')); + resetDevToolsFlag = false; end diff --git a/src/resetDevTools.m b/src/resetDevTools.m index fc731aa..f2c1738 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -10,32 +10,36 @@ function resetDevTools() global gitConf global gitCmd + global resetDevToolsFlag % call checkSystem to set default values for gitConf and gitCmd checkSystem(mfilename); - % unset the path to the local fork - [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); + if resetDevToolsFlag + % unset the path to the local fork + [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); - if status_gitConfForkDirGet == 0 - printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); - else - fprintf(result_gitConfForkDirGet); - fprintf([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); - end + if status_gitConfForkDirGet == 0 + printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); + else + fprintf(result_gitConfForkDirGet); + fprintf([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + end - % unset the user name - [status_gitConfUserGet, result_gitConfUserGet] = system('git config --global --unset-all user.github-username'); + % unset the user name + [status_gitConfUserGet, result_gitConfUserGet] = system('git config --global --unset-all user.github-username'); - if status_gitConfUserGet == 0 - printMsg(mfilename, 'Your Github username has been removed from your local git configuration.'); - else - fprintf(result_gitConfUserGet); - fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); - end + if status_gitConfUserGet == 0 + printMsg(mfilename, 'Your Github username has been removed from your local git configuration.'); + else + fprintf(result_gitConfUserGet); + fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + end - clear global gitConf; - clear global gitCmd; + clear global gitConf; + clear global gitCmd; + clear global resetDevToolsFlag; - fprintf([' [', mfilename, '] The development tools have been reset.\n']); + fprintf([' [', mfilename, '] The development tools have been reset.\n']); + end end From bf712bfb31ac9e2ab0d84c1204482233353c7798 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 12:48:28 +0100 Subject: [PATCH 117/163] Debugging R2015b --- src/initDevTools.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 6025e52..5b7e0fb 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -12,9 +12,9 @@ function initDevTools() global gitCmd global resetDevToolsFlag - resetDevToolsFlag = true; + %resetDevToolsFlag = true; - finishup = onCleanup(@() resetDevTools()); + %finishup = onCleanup(@() resetDevTools()); % check the system and set the configuration checkSystem(mfilename); @@ -189,6 +189,6 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); - resetDevToolsFlag = false; + %resetDevToolsFlag = false; end From 4df30d47bf4a89cdfb6682786502fd38a5344ce8 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 12:57:10 +0100 Subject: [PATCH 118/163] Further debugging --- src/addKeyToKnownHosts.m | 2 +- src/initDevTools.m | 6 +++--- src/resetDevTools.m | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/addKeyToKnownHosts.m b/src/addKeyToKnownHosts.m index 4062182..79f0862 100644 --- a/src/addKeyToKnownHosts.m +++ b/src/addKeyToKnownHosts.m @@ -55,7 +55,7 @@ error([gitCmd.lead, ' [', mfilename, ']', callerName, ' github.com could not be added to the known hosts file in ~/.ssh/known_hosts']); end else - printMsg(mfilename, [callerName, ' github.com is already a known host.\n']); + printMsg(mfilename, [callerName, ' github.com is already a known host.']); keyAdded = true; end else diff --git a/src/initDevTools.m b/src/initDevTools.m index 5b7e0fb..6025e52 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -12,9 +12,9 @@ function initDevTools() global gitCmd global resetDevToolsFlag - %resetDevToolsFlag = true; + resetDevToolsFlag = true; - %finishup = onCleanup(@() resetDevTools()); + finishup = onCleanup(@() resetDevTools()); % check the system and set the configuration checkSystem(mfilename); @@ -189,6 +189,6 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); - %resetDevToolsFlag = false; + resetDevToolsFlag = false; end diff --git a/src/resetDevTools.m b/src/resetDevTools.m index f2c1738..8dd14d6 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -41,5 +41,7 @@ function resetDevTools() clear global resetDevToolsFlag; fprintf([' [', mfilename, '] The development tools have been reset.\n']); + else + resetDevToolsFlag = true; end end From f8b83f6f75dda558219e86d8ce6d86d9503aec88 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 15 Feb 2018 13:08:44 +0100 Subject: [PATCH 119/163] Moving flag --- src/initDevTools.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 6025e52..c2846d9 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -146,6 +146,8 @@ function initDevTools() end end + resetDevToolsFlag = false; + % define the fork directory name gitConf.fullForkDir = strrep([gitConf.localDir, gitConf.forkDirName], '\', '\\'); @@ -189,6 +191,4 @@ function initDevTools() fprintf([gitCmd.lead, originCall, ' Remote fork URL: ', gitConf.forkURL, gitCmd.trail]); fprintf([gitCmd.lead, originCall, ' Remote repository URL: ', gitConf.remoteRepoURL, gitCmd.trail]); - resetDevToolsFlag = false; - end From 899680f1918bda426fd7f11541d18166e1ea3c04 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 16 Feb 2018 13:53:29 +0100 Subject: [PATCH 120/163] Minor fix for debugging --- contribute.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contribute.m b/contribute.m index 495c6ba..abb3436 100644 --- a/contribute.m +++ b/contribute.m @@ -25,7 +25,7 @@ function contribute(printLevel) % adding the src folder of the devTools addpath(genpath(fileparts(which(mfilename)))); - finishup = onCleanup(@() resetDevTools()) + finishup = onCleanup(@() resetDevTools()); % check the system and set the configuration checkSystem(mfilename); From 5ca7744922dfa56175903299a706869399518808 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 16 Feb 2018 13:53:53 +0100 Subject: [PATCH 121/163] Fixing the path of the fork --- src/initDevTools.m | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index c2846d9..e83ea25 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -98,8 +98,9 @@ function initDevTools() createDir = false; while ~createDir - reply = input([gitCmd.lead, originCall, ' -> Please define the local path to your fork\n current: ', strrep(pwd,'\','\\'),'\n Enter the path (press ENTER to use the current path): '], 's'); + reply = input([gitCmd.lead, originCall, ' -> Please define the location of your fork\n current: ', strrep(pwd,'\','\\'),'\n Enter the path (press ENTER to use the current path): '], 's'); + % define the local directory as the current directory if the reply is empty if isempty(reply) gitConf.localDir = strrep(pwd, '\', '\\'); else @@ -119,15 +120,15 @@ function initDevTools() end % warn the user of not using a fork-nickName directory or a git cloned directory as it will be cloned - if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) || exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains the nickname or a .git folder - reply = input([gitCmd.trail, gitCmd.lead, originCall, ' -> The specified directory already contains a ', gitConf.nickName, ' copy (clone) or is a git directory.', ... - gitCmd.trail, gitCmd.lead, originCall, ' -> Please provide the directory into which your fork should be cloned. Do you want to continue? Y/N [Y]:'], 's'); - - if isempty(reply) || strcmpi(reply, 'y') || strcmpi(reply, 'yes') - createDir = true; - else - createDir = false; + if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) % contains the nickname + printMsg(mfilename, ['The specified directory already contains a ', gitConf.nickName, ' copy (clone).'], gitCmd.trail); + createDir = true; + if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) + gitConf.localDir = gitConf.localDir(1:end-length(gitConf.nickName)-1-length(gitConf.leadForkDirName)); end + else if exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains a .git folder + printMsg(mfilename, ['The specified directory already is a git repository (git-tracked).'], gitCmd.trail); + createDir = false; else createDir = true; end From 4e8655002f265f43afd9fefdd2db47a798366165 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 16 Feb 2018 13:58:21 +0100 Subject: [PATCH 122/163] Formatting --- src/initDevTools.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index e83ea25..12f8aa9 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -126,9 +126,11 @@ function initDevTools() if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) gitConf.localDir = gitConf.localDir(1:end-length(gitConf.nickName)-1-length(gitConf.leadForkDirName)); end - else if exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains a .git folder + + elseif exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains a .git folder printMsg(mfilename, ['The specified directory already is a git repository (git-tracked).'], gitCmd.trail); createDir = false; + else createDir = true; end From fa51ee2e8a0ebe816aa580dd1f4c5a72d883b86c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 09:40:52 +0100 Subject: [PATCH 123/163] Removing redundant line --- src/initDevTools.m | 1 - 1 file changed, 1 deletion(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 12f8aa9..9ca0c57 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -129,7 +129,6 @@ function initDevTools() elseif exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains a .git folder printMsg(mfilename, ['The specified directory already is a git repository (git-tracked).'], gitCmd.trail); - createDir = false; else createDir = true; From 4f5460bdf9b56261cf121ec64fcc35e7bbf1a28c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 09:44:55 +0100 Subject: [PATCH 124/163] Removing redundant if condition --- src/initDevTools.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 9ca0c57..c56f06e 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -123,9 +123,7 @@ function initDevTools() if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) % contains the nickname printMsg(mfilename, ['The specified directory already contains a ', gitConf.nickName, ' copy (clone).'], gitCmd.trail); createDir = true; - if ~isempty(strfind(gitConf.localDir, gitConf.nickName)) - gitConf.localDir = gitConf.localDir(1:end-length(gitConf.nickName)-1-length(gitConf.leadForkDirName)); - end + gitConf.localDir = gitConf.localDir(1:end-length(gitConf.nickName)-1-length(gitConf.leadForkDirName)); elseif exist([gitConf.localDir, '/.git'], 'dir') == 7 % contains a .git folder printMsg(mfilename, ['The specified directory already is a git repository (git-tracked).'], gitCmd.trail); From 83ee0c0f9d1a27d4a4756e20315381c8536208e0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 08:23:09 +0100 Subject: [PATCH 125/163] Adding feature to configure the devtools from contribute --- contribute.m | 17 ++++++++++++----- src/checkSystem.m | 14 +++++++++++--- src/initDevTools.m | 15 ++++++++++++--- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/contribute.m b/contribute.m index abb3436..aab6a1b 100644 --- a/contribute.m +++ b/contribute.m @@ -1,4 +1,4 @@ -function contribute(printLevel) +function contribute(repoName, printLevel) % devTools % % PURPOSE: displays a menu and calls the respective subfunctions @@ -16,6 +16,7 @@ function contribute(printLevel) global gitConf global gitCmd global resetDevToolsFlag + global DEFAULTREPONAME resetDevToolsFlag = true; @@ -27,10 +28,16 @@ function contribute(printLevel) finishup = onCleanup(@() resetDevTools()); + % treatment of input arguments + if ~exist('repoName', 'var') + DEFAULTREPONAME = 'opencobra/cobratoolbox'; % set the default repository + repoName = DEFAULTREPONAME; + end + % check the system and set the configuration - checkSystem(mfilename); + checkSystem(mfilename, repoName); - if nargin > 0 + if nargin > 1 if printLevel > 0 gitConf.printLevel = printLevel; else @@ -38,7 +45,7 @@ function contribute(printLevel) end end - devToolsDir = fileparts(which('contribute.m')); + devToolsDir = fileparts(which(mfilename)); % change to the directory of the devTools cd(devToolsDir); @@ -79,7 +86,7 @@ function contribute(printLevel) exitFlag = false; else % initialize the development tools - initDevTools(); + initDevTools(repoName); % change to the fork diretory cd(gitConf.fullForkDir); diff --git a/src/checkSystem.m b/src/checkSystem.m index 4fe3882..4fdb290 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -1,12 +1,14 @@ -function checkSystem(callerName) +function checkSystem(callerName, repoName) % Checks the configuration of the system (installation of git and curl) % % USAGE: % -% checkSystem(callerName) +% checkSystem(callerName, repoName) % % INPUT: % callerName: Name of the function calling `checkSystem()` +% repoName: Name of the repository for which the devTools shall +% be configured (default: `opencobra/cobratoolbox`) % % .. Author: % - Laurent Heirendt @@ -14,14 +16,20 @@ function checkSystem(callerName) global gitConf global gitCmd + global DEFAULTREPONAME % add the public key from github.com to the known hosts addKeyToKnownHosts(); + % set the repoName if not given + if ~exist('repoName', 'var') + repoName = DEFAULTREPONAME; + end + % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) % default configuration of the devTools is the opencobra/cobratoolbox repository - confDevTools('opencobra/cobratoolbox'); + confDevTools(repoName); else confDevTools(gitConf.nickName, gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... 'printLevel', gitConf.printLevel); diff --git a/src/initDevTools.m b/src/initDevTools.m index c56f06e..9d450d1 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -1,23 +1,32 @@ -function initDevTools() +function initDevTools(repoName) % Initializes the development tools (username and email are requested if not configured) % % USAGE: % -% initDevTools() +% initDevTools(repoName) % +% INPUT: +% repoName: Name of the repository for which the devTools shall +% be configured (default: `opencobra/cobratoolbox`) % .. Author: % - Laurent Heirendt global gitConf global gitCmd global resetDevToolsFlag + global DEFAULTREPONAME + + % set the repoName if not given + if ~exist('repoName', 'var') + repoName = DEFAULTREPONAME; + end resetDevToolsFlag = true; finishup = onCleanup(@() resetDevTools()); % check the system and set the configuration - checkSystem(mfilename); + checkSystem(mfilename, repoName); if ~isfield(gitConf, 'userName'), gitConf.userName = []; end if ~isfield(gitConf, 'localDir'), gitConf.localDir = []; end From 0f807303693c75409bab2c605da12a65d583da0c Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 08:48:43 +0100 Subject: [PATCH 126/163] Check if the repoName is different from the present config --- src/checkSystem.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/checkSystem.m b/src/checkSystem.m index 4fdb290..28e1f90 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -26,6 +26,13 @@ function checkSystem(callerName, repoName) repoName = DEFAULTREPONAME; end + % reset the devTools if the repoName is different from the already configured repository + if ~isempty(gitConf) + if ~strcmpi(gitConf.remoteRepoURL, ['https://github.com/' repoName '.git']) + gitConf = []; % do not reset the devTools + end + end + % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) % default configuration of the devTools is the opencobra/cobratoolbox repository From 49d295e0b62dbf8a48b123b36f96af32412ce874 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 11:35:07 +0100 Subject: [PATCH 127/163] Fixes for printLevel --- contribute.m | 12 ++++-------- src/checkSystem.m | 31 +++++++++---------------------- src/confDevTools.m | 12 +++++++++--- src/listFeatures.m | 2 +- 4 files changed, 23 insertions(+), 34 deletions(-) diff --git a/contribute.m b/contribute.m index aab6a1b..695fb14 100644 --- a/contribute.m +++ b/contribute.m @@ -35,14 +35,10 @@ function contribute(repoName, printLevel) end % check the system and set the configuration - checkSystem(mfilename, repoName); - - if nargin > 1 - if printLevel > 0 - gitConf.printLevel = printLevel; - else - gitConf.printLevel = 0; - end + if exist('printLevel', 'var') + checkSystem(mfilename, repoName, printLevel); + else + checkSystem(mfilename, repoName); end devToolsDir = fileparts(which(mfilename)); diff --git a/src/checkSystem.m b/src/checkSystem.m index 28e1f90..4973090 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -1,4 +1,4 @@ -function checkSystem(callerName, repoName) +function checkSystem(callerName, repoName, printLevel) % Checks the configuration of the system (installation of git and curl) % % USAGE: @@ -9,6 +9,7 @@ function checkSystem(callerName, repoName) % callerName: Name of the function calling `checkSystem()` % repoName: Name of the repository for which the devTools shall % be configured (default: `opencobra/cobratoolbox`) +% printLevel: Level of verbose % % .. Author: % - Laurent Heirendt @@ -18,43 +19,33 @@ function checkSystem(callerName, repoName) global gitCmd global DEFAULTREPONAME - % add the public key from github.com to the known hosts - addKeyToKnownHosts(); - % set the repoName if not given if ~exist('repoName', 'var') repoName = DEFAULTREPONAME; end - % reset the devTools if the repoName is different from the already configured repository - if ~isempty(gitConf) - if ~strcmpi(gitConf.remoteRepoURL, ['https://github.com/' repoName '.git']) - gitConf = []; % do not reset the devTools - end + if ~exist('printLevel', 'var') && isempty(gitConf) + printLevel = 0; end % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) % default configuration of the devTools is the opencobra/cobratoolbox repository - confDevTools(repoName); + confDevTools(repoName, 'printLevel', printLevel); else - confDevTools(gitConf.nickName, gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... + confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... 'printLevel', gitConf.printLevel); end % set the callerName - if nargin < 1 + if nargin < 3 callerName = ''; - printLevel = 1; else - printLevel = 0; callerName = ['(caller: ', callerName, ')']; end - if printLevel > 0 - gitConfprintLevel = gitConf.printLevel; - gitConf.printLevel = 1; - end + % add the public key from github.com to the known hosts + addKeyToKnownHosts(); % check if git is properly installed [status_gitVersion, result_gitVersion] = system('git --version'); @@ -75,8 +66,4 @@ function checkSystem(callerName, repoName) fprintf(result_curl); error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); end - - if printLevel > 0 - gitConf.printLevel = gitConfprintLevel; - end end diff --git a/src/confDevTools.m b/src/confDevTools.m index 28b8041..0e25993 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -27,15 +27,21 @@ function confDevTools(repoName, varargin) global gitCmd % define default values - defaultLauncher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; defaultRemoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; defaultNickName = 'cobratoolbox'; - defaultPrintLevel = 1; + defaultPrintLevel = 0; % setup the parser parser = inputParser(); parser.addRequired('repoName', @ischar); - parser.addOptional('remoteRepoURL', ['https://github.com/' repoName '.git'], @ischar); + parser.addParamValue('remoteRepoURL', ['https://github.com/' repoName '.git'], @ischar); + + % set the defaultLauncher + if strcmpi(repoName, 'opencobra/cobratoolbox') + defaultLauncher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; + else + defaultLauncher = ['\n\n ~~~ ' repoName ' ~~~\n\n']; + end parser.addParamValue('launcher', defaultLauncher, @ischar); parser.addParamValue('nickName', defaultNickName, @ischar); parser.addParamValue('printLevel', defaultPrintLevel, @(x) isnumeric(x)); diff --git a/src/listFeatures.m b/src/listFeatures.m index c7c9448..e6d561e 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -41,7 +41,7 @@ arrResult = strtrim(arrResult); arrResult = arrResult(~cellfun(@isempty, arrResult)); - if length(arrResult) > 2 + if length(arrResult) > 3 fprintf('\n Available features are:\n'); % list the number of available features From 690be3c2b7c6200c1f23e17affbf470835388e30 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 11:44:52 +0100 Subject: [PATCH 128/163] Speeding up by omitting the check for git and curl --- src/checkSystem.m | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 4973090..561e0bb 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -30,7 +30,7 @@ function checkSystem(callerName, repoName, printLevel) % if a configuration has already been set, configure the devTools accordingly if isempty(gitConf) - % default configuration of the devTools is the opencobra/cobratoolbox repository + % default configuration of the devTools is the DEFAULTREPONAME repository confDevTools(repoName, 'printLevel', printLevel); else confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... @@ -44,26 +44,29 @@ function checkSystem(callerName, repoName, printLevel) callerName = ['(caller: ', callerName, ')']; end - % add the public key from github.com to the known hosts - addKeyToKnownHosts(); + % only check whether git and curl are installed if the gitConf object is empty + if isempty(gitConf) + % add the public key from github.com to the known hosts + addKeyToKnownHosts(); - % check if git is properly installed - [status_gitVersion, result_gitVersion] = system('git --version'); + % check if git is properly installed + [status_gitVersion, result_gitVersion] = system('git --version'); - if status_gitVersion == 0 && ~isempty(strfind(result_gitVersion, 'git version')) - printMsg(mfilename, [callerName, ' git is properly installed.']); - else - fprintf(result_gitVersion); - error([gitCmd.lead, ' [', mfilename, ']', callerName, ' git is not installed. Please follow the guidelines how to install git.']); - end + if status_gitVersion == 0 && ~isempty(strfind(result_gitVersion, 'git version')) + printMsg(mfilename, [callerName, ' git is properly installed.']); + else + fprintf(result_gitVersion); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' git is not installed. Please follow the guidelines how to install git.']); + end - % check if curl is properly installed - [status_curl, result_curl] = system('curl --version'); + % check if curl is properly installed + [status_curl, result_curl] = system('curl --version'); - if status_curl == 0 && ~isempty(strfind(result_curl, 'curl')) && ~isempty(strfind(result_curl, 'http')) - printMsg(mfilename, [callerName, ' curl is properly installed.']); - else - fprintf(result_curl); - error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); + if status_curl == 0 && ~isempty(strfind(result_curl, 'curl')) && ~isempty(strfind(result_curl, 'http')) + printMsg(mfilename, [callerName, ' curl is properly installed.']); + else + fprintf(result_curl); + error([gitCmd.lead, ' [', mfilename, ']', callerName, ' curl is not installed. Please follow the guidelines how to install curl.']); + end end end From e9d9ec38cb9cf3bcfdef4edc79e55736cd5b71c0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 14:45:28 +0100 Subject: [PATCH 129/163] Instructions how to reset when the devtools are already configured --- src/checkSystem.m | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 561e0bb..736ad46 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -33,8 +33,19 @@ function checkSystem(callerName, repoName, printLevel) % default configuration of the devTools is the DEFAULTREPONAME repository confDevTools(repoName, 'printLevel', printLevel); else - confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, 'launcher', gitConf.launcher, ... - 'printLevel', gitConf.printLevel); + % write instructions how to reset the devTools when they already configured + if strcmpi(callerName, 'contribute') + fprintf('\n'); + tmpPrintLevel = gitConf.printLevel; + gitConf.printLevel = 1; + printMsg(mfilename, [gitCmd.lead, ' The devTools are configured for the repository <', gitConf.nickName, '>']); + printMsg(mfilename, [gitCmd.lead, ' Please use >> resetDevTools() if you want to change the current configuration.']); + gitConf.printLevel = tmpPrintLevel; + + confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, + 'launcher', gitConf.launcher, ... + 'printLevel', gitConf.printLevel); + end end % set the callerName From 230ce3c4cc88f4db42fbfc705c6ba0d2bc099b91 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 14:54:14 +0100 Subject: [PATCH 130/163] Fix for multiline code --- src/checkSystem.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 736ad46..4838c22 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -42,7 +42,7 @@ function checkSystem(callerName, repoName, printLevel) printMsg(mfilename, [gitCmd.lead, ' Please use >> resetDevTools() if you want to change the current configuration.']); gitConf.printLevel = tmpPrintLevel; - confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, + confDevTools(gitConf.nickName, 'remoteRepoURL', gitConf.remoteRepoURL, ... 'launcher', gitConf.launcher, ... 'printLevel', gitConf.printLevel); end From 934370b505416ef466d220ddfe0a20c0fbf56f19 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 14:54:26 +0100 Subject: [PATCH 131/163] Adding feature for new year --- src/confDevTools.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index 0e25993..0bad74b 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -38,7 +38,8 @@ function confDevTools(repoName, varargin) % set the defaultLauncher if strcmpi(repoName, 'opencobra/cobratoolbox') - defaultLauncher = '\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2017\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n'; + c = clock; + defaultLauncher = ['\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - ', num2str(c(1)) , '\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n']; else defaultLauncher = ['\n\n ~~~ ' repoName ' ~~~\n\n']; end From 92c59818fd8d16da6f2cf2d9cd76a6645c519ab5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 15:01:54 +0100 Subject: [PATCH 132/163] Adding param to test --- test/testCheckSystem.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testCheckSystem.m b/test/testCheckSystem.m index 77b2c27..b31931e 100644 --- a/test/testCheckSystem.m +++ b/test/testCheckSystem.m @@ -11,7 +11,7 @@ resetDevTools(); % set the configuration -confDevTools(nickName, remoteRepoURL, 'launcher', launcher, ... +confDevTools(nickName, 'remoteRepoURL', remoteRepoURL, 'launcher', launcher, ... 'nickName', nickName, 'printLevel', printLevel); % check the system From 3f3260af80e6a43f528d03fd4d275cad166a7058 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 15:11:43 +0100 Subject: [PATCH 133/163] Fix for logical condition and global var --- src/checkSystem.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 4838c22..3be895e 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -17,11 +17,10 @@ function checkSystem(callerName, repoName, printLevel) global gitConf global gitCmd - global DEFAULTREPONAME % set the repoName if not given - if ~exist('repoName', 'var') - repoName = DEFAULTREPONAME; + if nargin < 2 || ~exist('repoName', 'var') || isempty(gitConf) + repoName = 'opencobra/cobratoolbox'; end if ~exist('printLevel', 'var') && isempty(gitConf) From ec1b6bb8cda53cd6ee690ebc18599b0c10a8ab2d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 15:34:25 +0100 Subject: [PATCH 134/163] moving paragraphs --- src/checkSystem.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 3be895e..79d3a9e 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -18,6 +18,13 @@ function checkSystem(callerName, repoName, printLevel) global gitConf global gitCmd + % set the callerName + if nargin < 3 + callerName = ''; + else + callerName = ['(caller: ', callerName, ')']; + end + % set the repoName if not given if nargin < 2 || ~exist('repoName', 'var') || isempty(gitConf) repoName = 'opencobra/cobratoolbox'; @@ -47,13 +54,6 @@ function checkSystem(callerName, repoName, printLevel) end end - % set the callerName - if nargin < 3 - callerName = ''; - else - callerName = ['(caller: ', callerName, ')']; - end - % only check whether git and curl are installed if the gitConf object is empty if isempty(gitConf) % add the public key from github.com to the known hosts From 2d4b69442ea693854863a704e356cd5b6e396891 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 22:40:17 +0100 Subject: [PATCH 135/163] Fixing spaces --- src/checkoutBranch.m | 4 ++-- src/cloneFork.m | 2 +- src/deleteContribution.m | 2 +- src/getCurrentBranchName.m | 2 +- src/history.m | 2 +- src/initContribution.m | 2 +- src/listFeatures.m | 8 ++++---- src/openPR.m | 2 +- src/printMsg.m | 6 +++--- src/submitContribution.m | 2 +- src/updateFork.m | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index fb8e07b..3e6a55d 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -6,8 +6,8 @@ function checkoutBranch(branchName, updateForkFlag) % checkoutBranch(branchName, updateForkFlag) % % INPUT: -% branchName: Name of the local branch to be checked out -% updateForkFlag: Boolean to update the fork before checking out the branch +% branchName: Name of the local branch to be checked out +% updateForkFlag: Boolean to update the fork before checking out the branch % % .. Author: % - Laurent Heirendt diff --git a/src/cloneFork.m b/src/cloneFork.m index 4aabb41..e2b003e 100644 --- a/src/cloneFork.m +++ b/src/cloneFork.m @@ -6,7 +6,7 @@ % freshClone = cloneFork() % % OUTPUT: -% freshClone: Boolean (true if a new clone has been made) +% freshClone: Boolean (true if a new clone has been made) % % .. Author: % - Laurent Heirendt diff --git a/src/deleteContribution.m b/src/deleteContribution.m index 68e15d6..182621d 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -6,7 +6,7 @@ function deleteContribution(branchName) % deleteContribution(branchName) % % INPUT: -% branchName: Name of the local branch to be deleted +% branchName: Name of the local branch to be deleted % % .. Author: % - Laurent Heirendt diff --git a/src/getCurrentBranchName.m b/src/getCurrentBranchName.m index 76f687e..39023ec 100644 --- a/src/getCurrentBranchName.m +++ b/src/getCurrentBranchName.m @@ -6,7 +6,7 @@ % currentBranch = getCurrentBranchName() % % OUTPUT: -% currentBranch: Name of the current branch +% currentBranch: Name of the current branch % % .. Author: % - Laurent Heirendt diff --git a/src/history.m b/src/history.m index fa235cf..e64e723 100644 --- a/src/history.m +++ b/src/history.m @@ -6,7 +6,7 @@ function history(fileName) % history(fileName) % % INPUT: -% fileName: Name of the file for which the history shall be displayed +% fileName: Name of the file for which the history shall be displayed % % .. Author: % - Laurent Heirendt diff --git a/src/initContribution.m b/src/initContribution.m index c3714d8..d550209 100644 --- a/src/initContribution.m +++ b/src/initContribution.m @@ -6,7 +6,7 @@ function initContribution(branchName) % initContribution(branchName) % % INPUT: -% branchName: Name of the local branch to be initialized +% branchName: Name of the local branch to be initialized % % .. Author: % - Laurent Heirendt diff --git a/src/listFeatures.m b/src/listFeatures.m index c7c9448..543c789 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -6,10 +6,10 @@ % [exitFlag, currentBranch, arrResult, exampleBranch] = listFeatures() % % OUTPUT: -% exitFlag: Boolean (true if proper exit of function) -% currentBranch: Name of current branch -% arrResult: Cell with all names of branches -% exampleBranch: Name of a branch given as an example +% exitFlag: Boolean (true if proper exit of function) +% currentBranch: Name of current branch +% arrResult: Cell with all names of branches +% exampleBranch: Name of a branch given as an example % % .. Author: % - Laurent Heirendt diff --git a/src/openPR.m b/src/openPR.m index 7edece7..7dea235 100644 --- a/src/openPR.m +++ b/src/openPR.m @@ -6,7 +6,7 @@ function openPR(branchName) % openPR(branchName) % % INPUT: -% branchName: Name of the branch for which a pull request (PR) shall be opened +% branchName: Name of the branch for which a pull request (PR) shall be opened % % .. Author: % - Laurent Heirendt diff --git a/src/printMsg.m b/src/printMsg.m index d658970..fa02796 100644 --- a/src/printMsg.m +++ b/src/printMsg.m @@ -6,9 +6,9 @@ function printMsg(fileName, msg, endMsg) % printMsg(fileName, msg, endMsg) % % INPUT: -% fileName: Name of the file from which the message is issued -% msg: Message as string -% endMsg: End of message, generally a new line character +% fileName: Name of the file from which the message is issued +% msg: Message as string +% endMsg: End of message, generally a new line character % % .. Author: diff --git a/src/submitContribution.m b/src/submitContribution.m index 9659d48..cf8aaad 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -6,7 +6,7 @@ function submitContribution(branchName) % submitContribution(branchName) % % INPUT: -% branchName: Name of the local branch to be pushed to the git server +% branchName: Name of the local branch to be pushed to the git server % % .. Author: % - Laurent Heirendt diff --git a/src/updateFork.m b/src/updateFork.m index e8e7478..20175c7 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -6,7 +6,7 @@ function updateFork(force) % updateFork(force) % % INPUT: -% force: Boolean flag to use force for updating the fork +% force: Boolean flag to use force for updating the fork % % .. Author: % - Laurent Heirendt From e5ba5cd5c017b2528293eed220cbde5fbcb1068a Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 19 Feb 2018 22:48:40 +0100 Subject: [PATCH 136/163] New instructions --- README.rst | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index 821f095..9740bd3 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ All repositories on Github are version controlled using `git `__, a free and open-source distributed, version control system, which tracks changes in computer files and is used for coordinating -work on those files by multiple people. +work on those files by multiple people. In order to lower the technological barrier to the use of the popular software development tool `git `__, we have developed @@ -111,8 +111,7 @@ changes made to a downloaded official ``git`` repository will be ignored). |important| If you get stuck or are faced with an system error message, please read -the -`FAQ `__. +the `FAQ `__. .. end-getstarted-marker @@ -127,24 +126,24 @@ Configure the ``MATLAB.devTools`` for another repository .. begin-contribute-other-repo-marker -|important| The ``MATLAB.devTools`` can only be used with **publicly accessible** -repositories. +|important| The ``MATLAB.devTools`` can only be used with **publicly accessible** repositories. -If you want to use the ``MATLAB.devTools`` with a repository other than -the default repository, you must set the following variables: +If you want to use the ``MATLAB.devTools`` when contributing to the +`COBRA.tutorials `__, you can simply configure +the ``MATLAB.devTools`` on-the-fly by typing: .. code:: matlab - launcher = '\n\n ~~~ MATLAB.devTools ~~~\n\n'; % a message for the repository (any string) - remoteRepoURL = 'https://server.com/repositoryName.git'; % the remote url - nickName = 'repoNickName'; % a nickName of the repository (any string) - printLevel = 0; % set the printLevel mode + >> contribute('opencobra/COBRA.tutorials') -and run: +If you want to use the ``MATLAB.devTools`` with a repository other than +the default repository, you may run: .. code:: matlab - >> confDevTools(launcher, remoteRepoURL, nickName, printLevel); % sets the configuration + >> contribute('userName/repositoryName') + +Please note that this command looks for a repository on `github.com `__. In order to reset the configuration, type: @@ -152,9 +151,6 @@ In order to reset the configuration, type: >> resetDevTools(); -If you want your changes to be permanent, you can set the above -mentioned variables in ``./src/confDevTools.m``. - .. end-contribute-other-repo-marker From 9177cd4923a9ca10d3ff901efdedc5e961e1ce8f Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 20 Feb 2018 07:02:19 +0100 Subject: [PATCH 137/163] Minor changes to headers --- src/confDevTools.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/confDevTools.m b/src/confDevTools.m index 28b8041..97852c4 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -6,7 +6,7 @@ function confDevTools(repoName, varargin) % confDevTools(repoName, remoteRepoURL, varargin) % % INPUTS: -% repoName: Name of the repository (default: 'cobratoolbox') +% repoName: Name of the repository (default: `'cobratoolbox'`) % % OPTIONAL INPUTS: % remoteRepoURL: URL of the repository @@ -15,9 +15,9 @@ function confDevTools(repoName, varargin) % printLevel: Verbose level (default: 1) % % Note: -% Currently, only 2 projects are defined: -% - cobratoolbox: https://www.github.com/opencobra/cobratoolbox -% - COBRA.tutorials: https://www.github.com/opencobra/COBRA.tutorials +% Currently, only 2 projects are defined: +% `The COBRA Toolbox `__ +% and `COBRA.tutorials `__ % % .. Author: % - Laurent Heirendt, January 2018 From da0276a25dbe7e64f183c2ae1c517e7a155e9c2a Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 20 Feb 2018 07:34:23 +0100 Subject: [PATCH 138/163] Minor changes to src --- src/cloneFork.m | 4 ++-- src/deleteContribution.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cloneFork.m b/src/cloneFork.m index e2b003e..4897e35 100644 --- a/src/cloneFork.m +++ b/src/cloneFork.m @@ -1,12 +1,12 @@ function freshClone = cloneFork() -% Clones the fork and updates the submodules of the repository +% Clone the fork and update the submodules of the repository % % USAGE: % % freshClone = cloneFork() % % OUTPUT: -% freshClone: Boolean (true if a new clone has been made) +% freshClone: Boolean (`true` if a new clone has been made) % % .. Author: % - Laurent Heirendt diff --git a/src/deleteContribution.m b/src/deleteContribution.m index 182621d..9002778 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -1,5 +1,5 @@ function deleteContribution(branchName) -% Deletes and existing feature (branch) named +% Delete an existing feature (branch) named `branchName` % % USAGE: % From 24a4bcce0b1a77ef2c17cf6dd1e2e47f26482845 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 20 Feb 2018 07:34:54 +0100 Subject: [PATCH 139/163] Minor changes --- README.rst | 37 ++++++++++++++++++++-------- docs/source/contr_cobratoolbox.rst | 18 +++++++------- docs/source/contr_cobratutorials.rst | 5 +++- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 9740bd3..526ad82 100644 --- a/README.rst +++ b/README.rst @@ -121,12 +121,10 @@ How can I update my fork without contributing? In order to only update your fork, run ``>> contribute`` and select menu item ``[5]``. -Configure the ``MATLAB.devTools`` for another repository --------------------------------------------------------- - -.. begin-contribute-other-repo-marker +Configure the ``MATLAB.devTools`` for ``COBRA.tutorials`` +--------------------------------------------------------- -|important| The ``MATLAB.devTools`` can only be used with **publicly accessible** repositories. +.. begin-contribute-cobratutorials-marker If you want to use the ``MATLAB.devTools`` when contributing to the `COBRA.tutorials `__, you can simply configure @@ -136,6 +134,16 @@ the ``MATLAB.devTools`` on-the-fly by typing: >> contribute('opencobra/COBRA.tutorials') +.. end-contribute-cobratutorials-marker + + +Configure the ``MATLAB.devTools`` for another repository +-------------------------------------------------------- + +.. begin-contribute-other-repo-marker + +|important| The ``MATLAB.devTools`` can only be used with **publicly accessible** repositories. + If you want to use the ``MATLAB.devTools`` with a repository other than the default repository, you may run: @@ -143,16 +151,21 @@ the default repository, you may run: >> contribute('userName/repositoryName') -Please note that this command looks for a repository on `github.com `__. +where ``userName`` is the name on Github of the organization or the user, and +``repositoryName`` is the name of the repository. The URL of the repository +would be `https://github.com/userName/repositoryName`. Please note that this +command looks for a repository on `github.com `__. -In order to reset the configuration, type: +.. end-contribute-other-repo-marker -.. code:: matlab +Reset the ``MATLAB.devTools`` +----------------------------- - >> resetDevTools(); +In order to reset the configuration of the ``MATLAB.devTools``, type: -.. end-contribute-other-repo-marker +.. code:: matlab + >> resetDevTools(); How to cite the ``MATLAB.devTools`` ----------------------------------- @@ -226,4 +239,8 @@ paper of The COBRA Toolbox shall we cited when referring to the ``MATLAB.devTool warning +.. |bulb| raw:: html + + bulb + .. end-icon-marker diff --git a/docs/source/contr_cobratoolbox.rst b/docs/source/contr_cobratoolbox.rst index ed14d55..fa53b5b 100644 --- a/docs/source/contr_cobratoolbox.rst +++ b/docs/source/contr_cobratoolbox.rst @@ -45,7 +45,7 @@ opencobra repository (option B). `cobratoolbox` folder, the user has read and write access, but cannot push eventual changes back to the opencobra repository. It is the default and stable ``master`` branch only that should be used. The local copy located in the cobratoolbox - directory can be updated (both branches). + directory can be updated (both branches). - **Option B** In order to make changes to the opencobra repository, or, in other words, contribute, you must obtain your own @@ -53,7 +53,7 @@ opencobra repository (option B). right corner of the official `opencobra/cobratoolbox `_ repository website in order to create a personal copy (or fork) with write and read access of the opencobra repository. This copy is - accessible under `https://github.com//cobratoolbox`, where `` is + accessible under `https://github.com//cobratoolbox`, where `` is your Github username. In the `fork-cobratoolbox` folder, other user specific branches may exist in addition to the ``master`` and ``develop`` branches. @@ -77,7 +77,7 @@ from the terminal (or shell): .. code:: console - $ git clone git@github.com:openCOBRA/MATLAB.devTools + $ git clone git@github.com:opencobra/MATLAB.devTools |warning| A working internet connection is required and git and curl must be installed. Installation instructions are provided on the main repository page @@ -120,13 +120,13 @@ particularly important in order to retrieve all changes that have been made to the opencobra repository in the meantime. .. code:: matlab - + >> contribute % then select procedure [2] Procedure ``[2]`` pulls all changes from the opencobra repository, and rebases the existing contribution. In other words, existing commits are shifted forward and placed after all commits made on the develop branch of the opencobra -repository. +repository. |warning| Before attempting to continue working on an existing feature, make sure that you published your commits. @@ -141,7 +141,7 @@ repository once a pull request has been submitted. It is not necessary to open a pull request if you want to simply upload your contribution to your fork. .. code:: matlab - + >> contribute % then select procedure [3] When running procedure ``[3]``, you have two options: @@ -182,7 +182,7 @@ using the MATLAB.devTools. Instead, create a new branch by following procedure |warning| Make sure that your changes are either merged or saved locally if you need them. Once procedure ``[4]`` is concluded, all changes on the deleted -branch are removed, both locally and remotely. No commits can be recovered. +branch are removed, both locally and remotely. No commits can be recovered. Update your fork ---------------- @@ -192,14 +192,14 @@ contribution. The local fork can be updated using procedure ``[5]`` of the contribute menu. .. code:: matlab - + >> contribute % then select procedure [5] Before updating your fork, make sure that no changes are present in the local directory `fork-cobratoolbox`. You can do so by typing: .. code:: matlab - + >> checkStatus If there are changes listed, publish them by selecting procedure ``[3]`` of the diff --git a/docs/source/contr_cobratutorials.rst b/docs/source/contr_cobratutorials.rst index f0874a2..da33a76 100644 --- a/docs/source/contr_cobratutorials.rst +++ b/docs/source/contr_cobratutorials.rst @@ -1,6 +1,9 @@ COBRA.tutorials ^^^^^^^^^^^^^^^ -Coming soon. +.. include:: ../../README.rst + :start-after: begin-contribute-cobratutorials-marker + :end-before: end-contribute-cobratutorials-marker +In case of troubleshooting, please refer `this <>`__ section. From 963455427976221c14de0b854e0afff74b62f307 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 20 Feb 2018 09:51:03 +0100 Subject: [PATCH 140/163] Change of if condition --- src/checkSystem.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index 79d3a9e..bc194c4 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -19,7 +19,7 @@ function checkSystem(callerName, repoName, printLevel) global gitCmd % set the callerName - if nargin < 3 + if ~exist('printLevel', 'var') callerName = ''; else callerName = ['(caller: ', callerName, ')']; From 4ca2788fc60c07f66921996490470fca52612827 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 20 Feb 2018 10:59:56 +0100 Subject: [PATCH 141/163] Fix for configuration of devtools --- src/checkSystem.m | 2 +- src/confDevTools.m | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/checkSystem.m b/src/checkSystem.m index bc194c4..828fcc8 100644 --- a/src/checkSystem.m +++ b/src/checkSystem.m @@ -26,7 +26,7 @@ function checkSystem(callerName, repoName, printLevel) end % set the repoName if not given - if nargin < 2 || ~exist('repoName', 'var') || isempty(gitConf) + if nargin < 2 || ~exist('repoName', 'var') repoName = 'opencobra/cobratoolbox'; end diff --git a/src/confDevTools.m b/src/confDevTools.m index 6995ada..dd4086d 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -27,8 +27,6 @@ function confDevTools(repoName, varargin) global gitCmd % define default values - defaultRemoteRepoURL = 'https://github.com/opencobra/cobratoolbox.git'; - defaultNickName = 'cobratoolbox'; defaultPrintLevel = 0; % setup the parser @@ -40,8 +38,13 @@ function confDevTools(repoName, varargin) if strcmpi(repoName, 'opencobra/cobratoolbox') c = clock; defaultLauncher = ['\n\n _____ _____ _____ _____ _____ |\n / ___| / _ \\ | _ \\ | _ \\ / ___ \\ | COnstraint-Based Reconstruction and Analysis\n | | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - ', num2str(c(1)) , '\n | | | | | | | _ { | _ / | ___ | |\n | |___ | |_| | | |_| | | | \\ \\ | | | | | Documentation:\n \\_____| \\_____/ |_____/ |_| \\_\\ |_| |_| | http://opencobra.github.io/cobratoolbox\n | \n\n']; + defaultNickName = 'cobratoolbox'; + elseif strcmpi(repoName, 'opencobra/COBRA.tutorials') + defaultLauncher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; + defaultNickName = 'COBRA.tutorials'; else defaultLauncher = ['\n\n ~~~ ' repoName ' ~~~\n\n']; + defaultNickName = repoName; end parser.addParamValue('launcher', defaultLauncher, @ischar); parser.addParamValue('nickName', defaultNickName, @ischar); @@ -65,14 +68,8 @@ function confDevTools(repoName, varargin) nickName = tmpNickName{1}; % define the configuration of other projects here - if strcmpi(repoName, 'opencobra/COBRA.tutorials') - launcher = '\n\n ~~~ COBRA.tutorials ~~~\n\n'; - nickName = 'COBRA.tutorials'; - else - launcher = parser.Results.launcher; - if printLevel > 0 - fprintf([' -- Assuming the default configuration (', nickName, ' repository)\n']); - end + if printLevel > 0 + fprintf([' -- Assuming the default configuration (', nickName, ' repository)\n']); end % definition of parameters @@ -81,7 +78,7 @@ function confDevTools(repoName, varargin) % define the printLevel gitConf.printLevel = printLevel; - gitConf.launcher = launcher; + gitConf.launcher = parser.Results.launcher; gitConf.remoteRepoURL = remoteRepoURL; gitConf.nickName = nickName; From 7b09b8c6cfef4da92397e4a60b3597971b25e6f0 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 21 Feb 2018 15:28:12 +0100 Subject: [PATCH 142/163] Loop for requesting confirmation of deletion --- src/deleteContribution.m | 78 +++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/deleteContribution.m b/src/deleteContribution.m index 9002778..2f61827 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -24,60 +24,64 @@ function deleteContribution(branchName) end if isempty(strfind(branchName, 'develop')) && isempty(strfind(branchName, 'master')) - reply = input([gitCmd.lead, originCall, 'Are you sure that you want to delete the feature (branch) <', branchName, '>? YES/NO [NO]: '], 's'); + reply = ''; - if ~isempty(reply) && strcmpi(reply, 'yes') % users MUST enter 'yes', not only 'y' + while isempty(reply) || ~strcmpi(reply, 'yes') - % checkout the develop branch - checkoutBranch('develop'); + reply = input([gitCmd.lead, originCall, 'Are you sure that you want to delete the feature (branch) <', branchName, '>? YES/NO [NO]: '], 's'); - % retrieve a list of all the branches - if ispc - filterColor = ''; - else - filterColor = '| tr -s "[:cntrl:]" "\n"'; - end + if strcmpi(reply, 'yes') % users MUST enter 'yes', not only 'y' + % checkout the develop branch + checkoutBranch('develop'); + + % retrieve a list of all the branches + if ispc + filterColor = ''; + else + filterColor = '| tr -s "[:cntrl:]" "\n"'; + end - [status_gitBranch, resultList] = system(['git branch --list ', filterColor]); + [status_gitBranch, resultList] = system(['git branch --list ', filterColor]); - % delete the local branch - if status_gitBranch == 0 - arrResult = strsplit(resultList, '\n'); - arrResult(~cellfun(@isempty, arrResult)); + % delete the local branch + if status_gitBranch == 0 + arrResult = strsplit(resultList, '\n'); + arrResult(~cellfun(@isempty, arrResult)); - if checkBranchExistence(branchName) - % delete the branch locally - [status_gitBranchDelete, result_gitBranchDelete] = system(['git branch -D ', branchName]); + if checkBranchExistence(branchName) + % delete the branch locally + [status_gitBranchDelete, result_gitBranchDelete] = system(['git branch -D ', branchName]); - if status_gitBranchDelete == 0 - fprintf([gitCmd.lead, originCall, 'The local <', branchName, '> feature (branch) has been deleted.', gitCmd.success, gitCmd.trail]); + if status_gitBranchDelete == 0 + fprintf([gitCmd.lead, originCall, 'The local <', branchName, '> feature (branch) has been deleted.', gitCmd.success, gitCmd.trail]); + else + fprintf(result_gitBranchDelete); + error([gitCmd.lead, ' [', mfilename,'] The local <', branchName,'> feature (branch) could not be deleted. You might have unpublished/uncommitted changes.', gitCmd.fail]); + end else - fprintf(result_gitBranchDelete); - error([gitCmd.lead, ' [', mfilename,'] The local <', branchName,'> feature (branch) could not be deleted. You might have unpublished/uncommitted changes.', gitCmd.fail]); + fprintf([gitCmd.lead, originCall, 'The local <', branchName,'> feature (branch) does not exist.', gitCmd.fail, gitCmd.trail]); end else - fprintf([gitCmd.lead, originCall, 'The local <', branchName,'> feature (branch) does not exist.', gitCmd.fail, gitCmd.trail]); + error([gitCmd.lead, ' [', mfilename,'] The list of features (branches) could not be retrieved.', gitCmd.fail]); end - else - error([gitCmd.lead, ' [', mfilename,'] The list of features (branches) could not be retrieved.', gitCmd.fail]); - end - % check if branch exists remotely - [status_curl, result_curl] = system(['curl -s -k --head ', gitConf.remoteServerName, gitConf.userName, '/', gitConf.remoteRepoName, '/tree/', branchName]); + % check if branch exists remotely + [status_curl, result_curl] = system(['curl -s -k --head ', gitConf.remoteServerName, gitConf.userName, '/', gitConf.remoteRepoName, '/tree/', branchName]); - % delete the remote branch - if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) + % delete the remote branch + if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) - [status_gitPush, result_gitPush] = system(['git push origin --delete ', branchName]); + [status_gitPush, result_gitPush] = system(['git push origin --delete ', branchName]); - if status_gitPush == 0 - fprintf([gitCmd.lead, originCall, 'The remote <', branchName, '> feature (branch) has been deleted.', gitCmd.success, gitCmd.trail]); + if status_gitPush == 0 + fprintf([gitCmd.lead, originCall, 'The remote <', branchName, '> feature (branch) has been deleted.', gitCmd.success, gitCmd.trail]); + else + fprintf(result_gitPush); + error([gitCmd.lead, ' [', mfilename,'] The remote <', branchName,'> feature (branch) could not be deleted.', gitCmd.fail]); + end else - fprintf(result_gitPush); - error([gitCmd.lead, ' [', mfilename,'] The remote <', branchName,'> feature (branch) could not be deleted.', gitCmd.fail]); + fprintf([gitCmd.lead, originCall, 'The remote <', branchName,'> feature (branch) does not exist.', gitCmd.fail, gitCmd.trail]); end - else - fprintf([gitCmd.lead, originCall, 'The remote <', branchName,'> feature (branch) does not exist.', gitCmd.fail, gitCmd.trail]); end end else From 0e69e8a14a8e9b6820c9c431d1f5b4a47ae59728 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 21 Feb 2018 15:32:43 +0100 Subject: [PATCH 143/163] Changing instructions for the COBRA Toolbox --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 526ad82..304d551 100644 --- a/README.rst +++ b/README.rst @@ -75,11 +75,12 @@ Some issues that can arise during installation are addressed in the Do you want to contribute to The COBRA Toolbox? ----------------------------------------------- -Please follow the `installation and contributing -instructions `__. - |asciicast| +More information about `the COBRA Toolbox +`__ is given `here +`__. + How do I use the ``MATLAB.devTools``? ------------------------------------- From 264649029c45fb0d606014ddcc609e2fc41f5aa9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 21 Feb 2018 16:24:13 +0100 Subject: [PATCH 144/163] Implementation of hard/soft reset --- src/initDevTools.m | 7 ++++--- src/resetDevTools.m | 51 ++++++++++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/initDevTools.m b/src/initDevTools.m index 9d450d1..03f8a22 100644 --- a/src/initDevTools.m +++ b/src/initDevTools.m @@ -97,6 +97,7 @@ function initDevTools(repoName) % retrieve the directory of the fork from the local git configuration [~, result_gitConfForkDirGet] = system(['git config --get user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); gitConf.fullForkDir = strtrim(result_gitConfForkDirGet); + gitConf.localDir = gitConf.fullForkDir; % check if the fork exists remotely checkRemoteFork(); @@ -142,6 +143,9 @@ function initDevTools(repoName) end end + % define the fork directory name + gitConf.fullForkDir = strrep([gitConf.localDir, gitConf.forkDirName], '\', '\\'); + if exist(gitConf.localDir, 'dir') ~= 7 reply = input([gitCmd.lead, originCall, ' -> The specified directory (', gitConf.localDir, ') does not exist. Do you want to create it? Y/N [Y]:'], 's'); @@ -157,9 +161,6 @@ function initDevTools(repoName) resetDevToolsFlag = false; - % define the fork directory name - gitConf.fullForkDir = strrep([gitConf.localDir, gitConf.forkDirName], '\', '\\'); - % permanently store the fork directory in the git configuration (ask the user explicitly) [status_gitConfForkDirSet, result_gitConfForkDirSet] = system(['git config --global user.', gitConf.leadForkDirName, gitConf.nickName, '.path "', gitConf.fullForkDir, '"']); if status_gitConfForkDirSet == 0 diff --git a/src/resetDevTools.m b/src/resetDevTools.m index 8dd14d6..d1cd136 100644 --- a/src/resetDevTools.m +++ b/src/resetDevTools.m @@ -1,10 +1,14 @@ -function resetDevTools() +function resetDevTools(hardReset) % Reset the configuration of the development tools % % USAGE: % % resetDevTools() % +% INPUTS: +% hardReset: Boolean to hard reset the devTools +% (changes the local `git` configuration) (default: `false`) +% % .. Author: % - Laurent Heirendt @@ -12,35 +16,48 @@ function resetDevTools() global gitCmd global resetDevToolsFlag + if ~exist('hardReset', 'var') + hardReset = false; + end + % call checkSystem to set default values for gitConf and gitCmd checkSystem(mfilename); if resetDevToolsFlag - % unset the path to the local fork - [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); + if hardReset + % unset the path to the local fork + [status_gitConfForkDirGet, result_gitConfForkDirGet] = system(['git config --global --unset user.', gitConf.leadForkDirName, gitConf.nickName, '.path']); - if status_gitConfForkDirGet == 0 - printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); - else - fprintf(result_gitConfForkDirGet); - fprintf([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); - end + if status_gitConfForkDirGet == 0 + printMsg(mfilename, 'Your fork directory has been removed from your local git configuration.'); + else + fprintf(result_gitConfForkDirGet); + fprintf([gitCmd.lead, ' [', mfilename,'] Your fork directory could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + end - % unset the user name - [status_gitConfUserGet, result_gitConfUserGet] = system('git config --global --unset-all user.github-username'); + % unset the user name + [status_gitConfUserGet, result_gitConfUserGet] = system('git config --global --unset-all user.github-username'); - if status_gitConfUserGet == 0 - printMsg(mfilename, 'Your Github username has been removed from your local git configuration.'); - else - fprintf(result_gitConfUserGet); - fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + if status_gitConfUserGet == 0 + printMsg(mfilename, 'Your Github username has been removed from your local git configuration.'); + else + fprintf(result_gitConfUserGet); + fprintf([gitCmd.lead, ' [', mfilename,'] Your Github username could not be removed from your local git configuration.', gitCmd.fail, gitCmd.trail]); + end end clear global gitConf; clear global gitCmd; clear global resetDevToolsFlag; - fprintf([' [', mfilename, '] The development tools have been reset.\n']); + % define an error message + if hardReset + resetMode = 'hard'; + else + resetMode = 'soft'; + end + + fprintf([' [', mfilename, '] The development tools have been reset (' resetMode ' reset).\n']); else resetDevToolsFlag = true; end From 8fa18266d07de8dcbef5abd8449cb36b41925f33 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 21 Feb 2018 16:30:15 +0100 Subject: [PATCH 145/163] Documentation for reset --- README.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.rst b/README.rst index 304d551..9d4e41f 100644 --- a/README.rst +++ b/README.rst @@ -168,6 +168,17 @@ In order to reset the configuration of the ``MATLAB.devTools``, type: >> resetDevTools(); +This performs a so-called `soft` reset (clears the local configuration). In +order to perform a hard reset (clears and resets the local ``git`` +configuration), run: + +.. code:: matlab + + >> resetDevTools(true); + +Once the devTools have been ``hard`` reset, all details for the configuration +have to be set again next time ``contribute`` is run. + How to cite the ``MATLAB.devTools`` ----------------------------------- From 6bd9c2b848cb1467729b361ab4a0bda56846f076 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 21 Feb 2018 16:59:49 +0100 Subject: [PATCH 146/163] Improved doc for reset --- README.rst | 10 +++++++--- contribute.m | 2 +- docs/source/faq.rst | 12 +++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index 9d4e41f..5a1e307 100644 --- a/README.rst +++ b/README.rst @@ -159,8 +159,10 @@ command looks for a repository on `github.com `__. .. end-contribute-other-repo-marker -Reset the ``MATLAB.devTools`` ------------------------------ +How to reset the ``MATLAB.devTools`` +------------------------------------ + +.. begin-reset-marker In order to reset the configuration of the ``MATLAB.devTools``, type: @@ -176,9 +178,11 @@ configuration), run: >> resetDevTools(true); -Once the devTools have been ``hard`` reset, all details for the configuration +Once the devTools have been `hard` reset, all details for the configuration have to be set again next time ``contribute`` is run. +.. end-reset-marker + How to cite the ``MATLAB.devTools`` ----------------------------------- diff --git a/contribute.m b/contribute.m index 695fb14..8b6ad05 100644 --- a/contribute.m +++ b/contribute.m @@ -51,7 +51,7 @@ function contribute(repoName, printLevel) fprintf(gitConf.launcher); - choice = input('\n (You can abort any process using CTRL-C)\n\n [1] Start a new feature (branch).\n [2] Select an existing feature (branch) to work on.\n [3] Publish a feature (branch).\n [4] Delete a feature (branch).\n [5] Update the fork.\n\n -> Please select what you want to do (enter the number): ', 's'); + choice = input('\n (You can abort any process using CTRL+C)\n\n [1] Start a new feature (branch).\n [2] Select an existing feature (branch) to work on.\n [3] Publish a feature (branch).\n [4] Delete a feature (branch).\n [5] Update the fork.\n\n -> Please select what you want to do (enter the number): ', 's'); choice = str2num(choice); diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 2b10c27..2cf3c72 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -91,11 +91,11 @@ Resolve unexpected behavior - reset ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you encounter unexpected behavior, please try to reset the -``MATLAB.devTools`` with: +``MATLAB.devTools`` using the ``resetDevTools`` functionality. -.. code:: matlab - - >> resetDevTools +.. include:: ../../README.rst + :start-after: begin-reset-marker + :end-before: end-reset-marker If you have files or changes that appear and would like to reset your local fork (without re-cloning) again, type: @@ -107,7 +107,5 @@ local fork (without re-cloning) again, type: How can I abort a process? ^^^^^^^^^^^^^^^^^^^^^^^^^^ -You can abort any process using ``CTRL-C`` (hit ``CTRL`` and ``C`` on +You can abort any process using ``CTRL+C`` (hit ``CTRL`` and ``C`` on your keyboard). - - From 91084cbeb5c4622177c36e32a7a453c1a4e8a691 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:16:21 +0100 Subject: [PATCH 147/163] Soft reset for new repository --- contribute.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contribute.m b/contribute.m index 8b6ad05..24d1930 100644 --- a/contribute.m +++ b/contribute.m @@ -34,6 +34,13 @@ function contribute(repoName, printLevel) repoName = DEFAULTREPONAME; end + % soft reset if the repository name is different + if ~isempty(gitConf) + if ~strcmpi(repoName, [gitConf.remoteUserName '/' gitConf.remoteRepoName]) + resetDevTools(); + end + end + % check the system and set the configuration if exist('printLevel', 'var') checkSystem(mfilename, repoName, printLevel); From df72cb63ef6730fca060cf68d8779cc6cdf07773 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:21:05 +0100 Subject: [PATCH 148/163] Change of nb of min characters --- src/submitContribution.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index cf8aaad..83f2fb7 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -187,7 +187,7 @@ function submitContribution(branchName) % if the commit message is not empty and minimum 5 characters (+2 quotes) for k = 1:length(dictFlags) - if length(commitMsg) >= 5+2 && isempty(strfind(commitMsg, dictFlags{k})) + if length(commitMsg) >= 4+2 && isempty(strfind(commitMsg, dictFlags{k})) incorrectCommitMsg = false; continue; else From 8d298d6233438c43a0482cbe2379f15bf836b603 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:30:55 +0100 Subject: [PATCH 149/163] Implement loop counter --- src/submitContribution.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index 83f2fb7..c084b30 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -163,8 +163,10 @@ function submitContribution(branchName) % initialize loop flag incorrectCommitMsg = true; + loopCounter = 0; + % loop as long as the commit message is not correct - while incorrectCommitMsg + while incorrectCommitMsg && loopCounter < 10 % ask the user for a commit message commitMsg = input([gitCmd.lead, originCall, ' -> Please enter a commit message (example: "Fixing bug with input arguments"): '], 's'); @@ -172,7 +174,7 @@ function submitContribution(branchName) commitMsg = regexprep(commitMsg, '[^a-zA-Z0-9_-?! ]', ''); % trim the commitMsg - commitMsg = strtrim(commitMsg); + commitMsg = strtrim(commitMsg) % add double quotes to the commit message if not set if isempty(commitMsg) @@ -195,6 +197,9 @@ function submitContribution(branchName) break; end end + + % increment the loop counter + loopCounter = loopCounter + 1; end % set the commit message From 6ae9e12aa4c8f5c948cb4a65147f3b824c124d1d Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:37:26 +0100 Subject: [PATCH 150/163] Commit message test --- test/inputCI.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/inputCI.txt b/test/inputCI.txt index b091fe7..1c1636f 100644 --- a/test/inputCI.txt +++ b/test/inputCI.txt @@ -7,4 +7,4 @@ n y testFile2 n -n +commitMsg-test From 8e4899a5a93c27fbc3af7a57a49cb89fb26c6607 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:43:18 +0100 Subject: [PATCH 151/163] Adding new input --- test/inputCI.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/inputCI.txt b/test/inputCI.txt index 1c1636f..5596c59 100644 --- a/test/inputCI.txt +++ b/test/inputCI.txt @@ -6,5 +6,5 @@ testFile1 n y testFile2 -n -commitMsg-test +N +message-test From 861d19de9da45620f4ac3cb0ca75dbab9dbd3437 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:50:04 +0100 Subject: [PATCH 152/163] Print a warning message for incorrect commit msg --- src/submitContribution.m | 4 ++++ test/inputCI.txt | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index c084b30..e059ada 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -198,6 +198,10 @@ function submitContribution(branchName) end end + if incorrectCommitMsg + warning([gitCmd.lead, 'The commit message must be at least 5 characters long and not contain the word `commit`.'); + end + % increment the loop counter loopCounter = loopCounter + 1; end diff --git a/test/inputCI.txt b/test/inputCI.txt index 5596c59..33f354e 100644 --- a/test/inputCI.txt +++ b/test/inputCI.txt @@ -6,5 +6,4 @@ testFile1 n y testFile2 -N message-test From 288f1863982931f8370d3cc86b9f66ee0f9d93de Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:52:56 +0100 Subject: [PATCH 153/163] bug fix --- src/submitContribution.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index e059ada..ffde39f 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -199,7 +199,7 @@ function submitContribution(branchName) end if incorrectCommitMsg - warning([gitCmd.lead, 'The commit message must be at least 5 characters long and not contain the word `commit`.'); + warning([gitCmd.lead, 'The commit message must be at least 5 characters long and not contain the word `commit`.']); end % increment the loop counter From a1b15d7fadfff45224454bba0b8c3f83220001de Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 12:57:28 +0100 Subject: [PATCH 154/163] Removing output after debugging --- src/submitContribution.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/submitContribution.m b/src/submitContribution.m index ffde39f..9267fd8 100644 --- a/src/submitContribution.m +++ b/src/submitContribution.m @@ -174,7 +174,7 @@ function submitContribution(branchName) commitMsg = regexprep(commitMsg, '[^a-zA-Z0-9_-?! ]', ''); % trim the commitMsg - commitMsg = strtrim(commitMsg) + commitMsg = strtrim(commitMsg); % add double quotes to the commit message if not set if isempty(commitMsg) From d4a849572275abf0b1af1542df4f748b2541b4cf Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Thu, 22 Feb 2018 13:24:10 +0100 Subject: [PATCH 155/163] Adding a check of the URL before configuring the devTools --- contribute.m | 4 ++-- src/confDevTools.m | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/contribute.m b/contribute.m index 24d1930..af50fc7 100644 --- a/contribute.m +++ b/contribute.m @@ -26,8 +26,6 @@ function contribute(repoName, printLevel) % adding the src folder of the devTools addpath(genpath(fileparts(which(mfilename)))); - finishup = onCleanup(@() resetDevTools()); - % treatment of input arguments if ~exist('repoName', 'var') DEFAULTREPONAME = 'opencobra/cobratoolbox'; % set the default repository @@ -48,6 +46,8 @@ function contribute(repoName, printLevel) checkSystem(mfilename, repoName); end + finishup = onCleanup(@() resetDevTools()); + devToolsDir = fileparts(which(mfilename)); % change to the directory of the devTools diff --git a/src/confDevTools.m b/src/confDevTools.m index dd4086d..dd7811f 100644 --- a/src/confDevTools.m +++ b/src/confDevTools.m @@ -62,6 +62,15 @@ function confDevTools(repoName, varargin) remoteRepoURL = parser.Results.remoteRepoURL; printLevel = parser.Results.printLevel; + % strip the .git at the end + tmpRemoteRepoURL = remoteRepoURL(1:end-4); + + % check if the remoteRepoURL exists before proceeding + [status_curl, result_curl] = system(['curl -s -k --head ', tmpRemoteRepoURL]); + if ~(status_curl == 0 && ~isempty(strfind(result_curl, '200 OK'))) + error([' [', mfilename, '] The URL (' remoteRepoURL ') is not reachable or does not exist.']); + end + % set the default nickName urlSplit = strsplit(remoteRepoURL, '/'); tmpNickName = strsplit(urlSplit{end}, '.git'); From 51d32be1ade272f7e5c3111354ce98006f6a7f38 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 23 Feb 2018 18:28:07 +0100 Subject: [PATCH 156/163] Draft of function to check for the existence of a branch remotely --- src/checkRemoteBranchExistence.m | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/checkRemoteBranchExistence.m diff --git a/src/checkRemoteBranchExistence.m b/src/checkRemoteBranchExistence.m new file mode 100644 index 0000000..a12cc77 --- /dev/null +++ b/src/checkRemoteBranchExistence.m @@ -0,0 +1,29 @@ +function branchExists = checkRemoteBranchExistence(branchName) +% Checks if a branch exists locally +% +% USAGE: +% +% branchExists = checkRemoteBranchExistence(branchName) +% +% INPUT: +% branchName: Name of the remote branch to be checked for existence +% +% OUTPUT: +% branchExists: Boolean (true if `branchName` esists) +% +% .. Author: +% - Laurent Heirendt + + global gitConf + + % retrieve a list of all the branches + [status_curl, result_curl] = system(['curl -s -k --head ' gitConf.remoteRepoURL '/tree/' branchName]); + + if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) + printMsg(mfilename, ['The branch <' branchName '> exists remotely.']); + branchExists = true; + else + printMsg(mfilename, ['The remote <' branchName '> does not exist remotely.']); + branchExists = false; + end +end From 3df80673a3b38c3aa460d613abc48502943bdef2 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 23 Feb 2018 18:38:54 +0100 Subject: [PATCH 157/163] Simplifying code for remote existence of branch --- src/checkoutBranch.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 3e6a55d..5131c01 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -215,11 +215,12 @@ function checkoutBranch(branchName, updateForkFlag) % check the system checkSystem(mfilename); - % if a branch does not exist remotely but exists locally, push it after confirmation from the user - [status_curl, result_curl] = system(['curl -s -k --head ', gitConf.remoteServerName, gitConf.userName, '/', gitConf.remoteRepoName, '/tree/', branchName]); + % check of the branch exists locally and remotely + branchExistsLocally = checkBranchExistence(branchName); + branchExistsRemotely = checkRemoteBranchExistence(branchName); % check if the branch exists remotely - if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) && checkBranchExistence(branchName) + if branchExistsRemotely && branchExistsLocally printMsg(mfilename, ['The <', branchName, '> feature (branch) exists locally and remotely on <', gitConf.forkURL, '>.']); else % the branch exists locally but not remotely! From c1619a9cd10db1f07c25131812b5efb6876b7cc8 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Fri, 23 Feb 2018 18:53:54 +0100 Subject: [PATCH 158/163] Fallback to master branch in checkout --- src/checkoutBranch.m | 58 +++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 5131c01..6af38d2 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -39,9 +39,16 @@ function checkoutBranch(branchName, updateForkFlag) % retrieve the status [status_gitStatus, result_gitStatus] = system('git status -s'); - if status_gitBranch == 0 && ~strcmpi('develop', currentBranch) && isempty(result_gitStatus) && status_gitStatus == 0 + % check if the develop branch exists remotely + if checkRemoteBranchExistence('develop') + mainBranch = 'develop'; + else + mainBranch = 'master'; % fall back to master, which always exists + end - printMsg(mfilename, ['The current feature (branch) ', currentBranch, ' is not the feature (branch).'], [gitCmd.fail, gitCmd.trail]); + if status_gitBranch == 0 && ~strcmpi(mainBranch, currentBranch) && isempty(result_gitStatus) && status_gitStatus == 0 + + printMsg(mfilename, ['The current feature (branch) ', currentBranch, ' is not the <' mainBranch '> feature (branch).'], [gitCmd.fail, gitCmd.trail]); % update the fork locally if updateForkFlag @@ -49,40 +56,40 @@ function checkoutBranch(branchName, updateForkFlag) end % checkout the develop branch (after update of the fork) - [status_gitCheckout, result_gitCheckout] = system('git checkout develop'); + [status_gitCheckout, result_gitCheckout] = system(['git checkout ' mainBranch]); % retrieve the name of the current branch currentBranch = getCurrentBranchName(); - if status_gitCheckout == 0 && strcmpi('develop', currentBranch) - printMsg(mfilename, 'The current feature (branch) is .'); + if status_gitCheckout == 0 && strcmpi(mainBranch, currentBranch) + printMsg(mfilename, ['The current feature (branch) is <' mainBranch '>.']); else fprintf(result_gitCheckout); - error([gitCmd.lead, 'An error occurred and the feature (branch) cannot be checked out']); + error([gitCmd.lead, 'An error occurred and the <' mainBranch '> feature (branch) cannot be checked out']); end % reset the develop branch - [status_gitReset, result_gitReset] = system('git reset --hard upstream/develop'); + [status_gitReset, result_gitReset] = system(['git reset --hard upstream/' mainBranch]); if status_gitReset == 0 if gitConf.printLevel > 0 - fprintf([gitCmd.lead, ' [', mfilename, '] The current feature (branch) is .', gitCmd.success, gitCmd.trail]); + fprintf([gitCmd.lead, ' [', mfilename, '] The current feature (branch) is <' mainBranch '>.', gitCmd.success, gitCmd.trail]); end else fprintf(result_gitReset); - error([gitCmd.lead, 'The feature (branch) cannot be checked out']); + error([gitCmd.lead, 'The <' mainBranch '> feature (branch) cannot be checked out']); end % update all submodules updateSubmodules(); % make sure that the develop branch is up to date - [status_gitPull, result_gitPull] = system('git pull origin develop'); + [status_gitPull, result_gitPull] = system(['git pull origin ' mainBranch]); if status_gitPull == 0 - printMsg(mfilename, 'The changes on the feature (branch) of your fork have been pulled.'); + printMsg(mfilename, ['The changes on the <' mainBranch '> feature (branch) of your fork have been pulled.']); else fprintf(result_gitPull); - error([gitCmd.lead, 'The changes on the feature (branch) could not be pulled.', gitCmd.fail]); + error([gitCmd.lead, ['The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); end end @@ -110,11 +117,11 @@ function checkoutBranch(branchName, updateForkFlag) if status_gitStatus == 0 && isempty(result_gitStatus) % perform a rebase - [status_gitRebase, result_gitRebase] = system('git rebase develop'); + [status_gitRebase, result_gitRebase] = system(['git rebase ' mainBranch]); % if the message after rebase does not contain up to data and not cannot rebase if status_gitRebase == 0 && isempty(strfind(result_gitRebase, 'up to date')) && isempty(strfind(result_gitRebase, 'Cannot rebase')) - printMsg(mfilename, ['The <', branchName, '> feature (branch) has been rebased with .']); + printMsg(mfilename, ['The <', branchName, '> feature (branch) has been rebased with <' mainBranch '>.']); % push by force the rebased branch [status_gitPush, result_gitPush] = system(['git push origin ', branchName, ' --force']); @@ -128,7 +135,7 @@ function checkoutBranch(branchName, updateForkFlag) [status_gitRebaseAbort, ~] = system('git rebase --abort'); if status_gitRebaseAbort == 0 - printMsg(mfilename, ['The rebase process of <', branchName,'> with has been aborted.'], [gitCmd.fail, gitCmd.trail]); + printMsg(mfilename, ['The rebase process of <', branchName, '> with <' mainBranch '> has been aborted.'], [gitCmd.fail, gitCmd.trail]); end % if the message after rebase contains : cannot rebase @@ -137,13 +144,14 @@ function checkoutBranch(branchName, updateForkFlag) reply = input([gitCmd.lead, ' -> Do you want to reset your feature (branch) <', branchName, '>. Y/N [N]: '], 's'); if ~isempty(reply) || strcmpi(reply, 'y') || strcmpi(reply, 'yes') - [status_curl, result_curl] = system(['curl -s -k --head ', gitConf.remoteServerName, gitConf.userName, '/', gitConf.remoteRepoName, '/tree/', branchName]); - if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) + branchNameExistsRemotely = checkRemoteBranchExistence(branchName); + + if branchNameExistsRemotely % hard reset of an existing branch [status_gitReset, result_gitReset] = system(['git reset --hard origin/', branchName]); if status_gitReset == 0 - printMsg(mfilename, ['The <', branchName, '> feature (branch) has not been rebased with and is up to date.']); + printMsg(mfilename, ['The <', branchName, '> feature (branch) has not been rebased with <' mainBranch '> and is up to date.']); else fprintf(result_gitReset); error([gitCmd.lead, ' [', mfilename, '] The <', branchName, '> could not be reset.', gitCmd.fail]); @@ -182,32 +190,32 @@ function checkoutBranch(branchName, updateForkFlag) if ~strcmp(branchName, currentBranch) % checkout the develop branch (soft checkout without merg) - [status_gitCheckout, result_gitCheckout] = system('git checkout develop'); + [status_gitCheckout, result_gitCheckout] = system(['git checkout ' mainBranch]); % retrieve the name of the current branch currentBranch = getCurrentBranchName(); - if status_gitCheckout == 0 && strcmpi('develop', currentBranch) - printMsg(mfilename, 'The current feature (branch) is .'); + if status_gitCheckout == 0 && strcmpi(mainBranch, currentBranch) + printMsg(mfilename, ['The current feature (branch) is <' mainBranch '>.']); % update all submodules updateSubmodules(); % make sure that the develop branch is up to date - [status_gitPull, result_gitPull] = system('git pull origin develop'); + [status_gitPull, result_gitPull] = system(['git pull origin ' mainBranch]); if status_gitPull == 0 - printMsg(mfilename, 'The changes on the feature (branch) of your fork have been pulled.'); + printMsg(mfilename, ['The changes on the <' mainBranch '> feature (branch) of your fork have been pulled.']); else fprintf(result_gitPull); - error([gitCmd.lead, 'The changes on the feature (branch) could not be pulled.', gitCmd.fail]); + error([gitCmd.lead, ['The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); end % checkout the branch but do not update the fork checkoutBranch(branchName, false); else fprintf(result_gitCheckout); - fprintf([gitCmd.lead, 'The feature (branch) cannot be checked out']); + fprintf([gitCmd.lead 'The <' mainBranch '> feature (branch) cannot be checked out']); end end end From 723ee08712d5aac52219aedfcf4f3161b37b7b78 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 26 Feb 2018 11:51:54 -0500 Subject: [PATCH 159/163] Changes to open PR when falling back to master --- src/checkoutBranch.m | 4 ++-- src/listFeatures.m | 9 ++++++++- src/openPR.m | 9 ++++++++- src/updateFork.m | 6 +++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/checkoutBranch.m b/src/checkoutBranch.m index 6af38d2..18cab37 100644 --- a/src/checkoutBranch.m +++ b/src/checkoutBranch.m @@ -89,7 +89,7 @@ function checkoutBranch(branchName, updateForkFlag) printMsg(mfilename, ['The changes on the <' mainBranch '> feature (branch) of your fork have been pulled.']); else fprintf(result_gitPull); - error([gitCmd.lead, ['The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); + error([gitCmd.lead, 'The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); end end @@ -208,7 +208,7 @@ function checkoutBranch(branchName, updateForkFlag) printMsg(mfilename, ['The changes on the <' mainBranch '> feature (branch) of your fork have been pulled.']); else fprintf(result_gitPull); - error([gitCmd.lead, ['The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); + error([gitCmd.lead, 'The changes on the <' mainBranch '> feature (branch) could not be pulled.', gitCmd.fail]); end % checkout the branch but do not update the fork diff --git a/src/listFeatures.m b/src/listFeatures.m index 54cfadc..06d955a 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -36,12 +36,19 @@ % give an example name exampleBranch = gitConf.exampleBranch; + % check if the develop branch exists remotely + if checkRemoteBranchExistence('develop') + nbBranches = 3; + else + nbBranches = 2; + end + if status == 0 arrResult = regexp(result,'\s+','split'); %strsplit is not compatible with older versions of MATLAB arrResult = strtrim(arrResult); arrResult = arrResult(~cellfun(@isempty, arrResult)); - if length(arrResult) > 3 + if length(arrResult) > nbBranches fprintf('\n Available features are:\n'); % list the number of available features diff --git a/src/openPR.m b/src/openPR.m index 7dea235..cb6111a 100644 --- a/src/openPR.m +++ b/src/openPR.m @@ -23,8 +23,15 @@ function openPR(branchName) originCall = ''; end + % check if the develop branch exists remotely + if checkRemoteBranchExistence('develop') + mainBranch = 'develop'; + else + mainBranch = 'master'; % fall back to master, which always exists + end + % define the URL of the pull request - prURL = [gitConf.remoteRepoURL(1:end-4), '/compare/develop...', gitConf.userName, ':', branchName]; + prURL = [gitConf.remoteRepoURL(1:end-4), '/compare/' mainBranch '...', gitConf.userName, ':', branchName]; % check if this URL exists [status_curl, result_curl] = system(['curl -s -k --head ', prURL]); diff --git a/src/updateFork.m b/src/updateFork.m index 20175c7..f66b36d 100644 --- a/src/updateFork.m +++ b/src/updateFork.m @@ -25,7 +25,11 @@ function updateFork(force) currentDir = strrep(pwd, '\', '\\'); % list the branches that should be updated - branches = {'master', 'develop'}; + if checkRemoteBranchExistence('develop') + branches = {'master', 'develop'}; + else + branches = {'master'}; % fall back to master, which always exists + end % change to the directory of the fork cd(gitConf.fullForkDir) From e12dc41cd9d885c0429458fe576c58640449f42b Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 26 Feb 2018 15:40:05 -0500 Subject: [PATCH 160/163] Fixing reply --- src/listFeatures.m | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/listFeatures.m b/src/listFeatures.m index 06d955a..a037d6c 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -65,15 +65,20 @@ fprintf('\n'); else - reply = input(' -> You do not have any features (branches). Do you want to start a new feature (branch)? Y/N [Y]: ', 's'); - - % decide whether to start a new feature (branch) or not - if ~isempty(reply) && (strcmpi(reply, 'y') || strcmpi(reply, 'yes')) - initContribution; - exitFlag = true; - else - fprintf(' -> Please start again. Goodbye.\n') - exitFlag = true; + reply = ''; + while isempty(reply) || (~strcmpi(reply, 'y') && ~strcmpi(reply, 'yes')) || (~strcmpi(reply, 'n') && ~strcmpi(reply, 'no')) + + reply = input(' -> You do not have any features (branches). Do you want to start a new feature (branch)? Y/N [Y]: ', 's'); + + % decide whether to start a new feature (branch) or not + if strcmpi(reply, 'y') || strcmpi(reply, 'yes') + initContribution; + exitFlag = true; + break; + elseif strcmpi(reply, 'n') || strcmpi(reply, 'no') + fprintf(' -> Please start again. Goodbye.\n') + exitFlag = true; + end end end end From 847d5bdcb687d34c9d89f2c8126e47f913add562 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Mon, 26 Feb 2018 19:34:24 -0500 Subject: [PATCH 161/163] Fix for loop condition --- src/listFeatures.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/listFeatures.m b/src/listFeatures.m index a037d6c..dca884f 100644 --- a/src/listFeatures.m +++ b/src/listFeatures.m @@ -66,7 +66,7 @@ fprintf('\n'); else reply = ''; - while isempty(reply) || (~strcmpi(reply, 'y') && ~strcmpi(reply, 'yes')) || (~strcmpi(reply, 'n') && ~strcmpi(reply, 'no')) + while isempty(reply) reply = input(' -> You do not have any features (branches). Do you want to start a new feature (branch)? Y/N [Y]: ', 's'); @@ -78,6 +78,8 @@ elseif strcmpi(reply, 'n') || strcmpi(reply, 'no') fprintf(' -> Please start again. Goodbye.\n') exitFlag = true; + else + reply = ''; end end end From f6e9a7d4b45070ad9d8be1df3bd81dea965bb5f5 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Tue, 27 Feb 2018 16:52:18 -0500 Subject: [PATCH 162/163] Fix for empty branchName --- src/initContribution.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/initContribution.m b/src/initContribution.m index d550209..3c009a7 100644 --- a/src/initContribution.m +++ b/src/initContribution.m @@ -34,8 +34,10 @@ function initContribution(branchName) if ~isempty(strfind(branchName, 'develop')) || ~isempty(strfind(branchName, 'master')) branchName = ''; fprintf([gitCmd.lead, ' -> Please use a different name that does not contain or .', gitCmd.fail, gitCmd.trail]); - else + elseif ~isempty(branchName) checkoutFlag = true; + else + branchName = ''; end end end From 8681281acf038f1c7aa572d2d63747edc61d05a9 Mon Sep 17 00:00:00 2001 From: laurentheirendt Date: Wed, 28 Feb 2018 21:39:36 -0500 Subject: [PATCH 163/163] Fixing deletion bug --- src/checkRemoteBranchExistence.m | 9 ++++++++- src/deleteContribution.m | 17 +++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/checkRemoteBranchExistence.m b/src/checkRemoteBranchExistence.m index a12cc77..08ad916 100644 --- a/src/checkRemoteBranchExistence.m +++ b/src/checkRemoteBranchExistence.m @@ -16,8 +16,15 @@ global gitConf + % remove .git from the remoteRepoURL + if strcmpi(gitConf.remoteRepoURL(end-3:end), '.git') + tmpRepoName = gitConf.remoteRepoURL(1:end-4); + else + tmpRepoName = gitConf.remoteRepoURL; + end + % retrieve a list of all the branches - [status_curl, result_curl] = system(['curl -s -k --head ' gitConf.remoteRepoURL '/tree/' branchName]); + [status_curl, result_curl] = system(['curl -s -k --head ' tmpRepoName '/tree/' branchName]); if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) printMsg(mfilename, ['The branch <' branchName '> exists remotely.']); diff --git a/src/deleteContribution.m b/src/deleteContribution.m index 2f61827..f60c390 100644 --- a/src/deleteContribution.m +++ b/src/deleteContribution.m @@ -31,8 +31,16 @@ function deleteContribution(branchName) reply = input([gitCmd.lead, originCall, 'Are you sure that you want to delete the feature (branch) <', branchName, '>? YES/NO [NO]: '], 's'); if strcmpi(reply, 'yes') % users MUST enter 'yes', not only 'y' - % checkout the develop branch - checkoutBranch('develop'); + + % check if the develop branch exists remotely + if checkRemoteBranchExistence('develop') + mainBranch = 'develop'; + else + mainBranch = 'master'; % fall back to master, which always exists + end + + % checkout the develop branch + checkoutBranch(mainBranch); % retrieve a list of all the branches if ispc @@ -65,11 +73,8 @@ function deleteContribution(branchName) error([gitCmd.lead, ' [', mfilename,'] The list of features (branches) could not be retrieved.', gitCmd.fail]); end - % check if branch exists remotely - [status_curl, result_curl] = system(['curl -s -k --head ', gitConf.remoteServerName, gitConf.userName, '/', gitConf.remoteRepoName, '/tree/', branchName]); - % delete the remote branch - if status_curl == 0 && ~isempty(strfind(result_curl, '200 OK')) + if checkRemoteBranchExistence(branchName) [status_gitPush, result_gitPush] = system(['git push origin --delete ', branchName]);