Functions¶

addKeyToKnownHosts(callerName)[source]

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

Input

• callerName – Name of the function calling (default: empty string)

Output

• keyAdded – Boolean (true if key has been added successfully or exists)
checkBranchExistence(branchName)[source]

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)
checkDevTools()[source]

Checks the configuration of the development tools

Usage

checkDevTools()
checkLocalFork()[source]

Checks the configuration of remotes in the local copy of the fork

Usage

checkLocalFork()
checkRemoteBranchExistence(branchName)[source]

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)
checkRemoteFork()[source]

Checks whether the fork exists remotely

Usage

checkRemoteFork()
checkStatus()[source]

Checks the status of the repository

Usage

checkStatus()
checkSystem(callerName, repoName, printLevel)[source]

Checks the configuration of the system (installation of git and curl)

Usage

checkSystem(callerName, repoName)

Inputs

• 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
checkoutBranch(branchName, updateForkFlag)[source]

checks out a branch named <branchName> locally and remotely

Usage

checkoutBranch(branchName, updateForkFlag)

Inputs

• branchName – Name of the local branch to be checked out
• updateForkFlag – Boolean to update the fork before checking out the branch
cloneFork()[source]

Clone the fork and update the submodules of the repository

Usage

freshClone = cloneFork()

Output

• freshClone – Boolean (true if a new clone has been made)
confDevTools(repoName, varargin)[source]

Configure the devTools by defining the gitConf object

Usage

confDevTools(repoName, remoteRepoURL, varargin)

Input

• 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)

Note

Currently, only 2 projects are defined: The COBRA Toolbox and COBRA.tutorials

configureFork()[source]

Configures the remotes of the local fork (upstream)

Usage

configureFork()
deleteContribution(branchName)[source]

Delete an existing branch named branchName

Usage

deleteContribution(branchName)

Input

• branchName – Name of the local branch to be deleted
getCurrentBranchName()[source]

Retrieve the name of the current branch

Usage

currentBranch = getCurrentBranchName()

Output

• currentBranch – Name of the current branch
history(fileName)[source]

Displays the history of a file

Usage

history(fileName)

Input

• fileName – Name of the file for which the history shall be displayed
initContribution(branchName)[source]

Initializes a new branch named branchName

Usage

initContribution(branchName)

Input

• branchName – Name of the local branch to be initialized
initDevTools(repoName)[source]

Initializes the development tools (username and email are requested if not configured)

Usage

initDevTools(repoName)

Input

• repoName – Name of the repository for which the devTools shall be configured (default: opencobra/cobratoolbox)
listBranches()[source]

Lists all available branches

Usage

[exitFlag, currentBranch, arrResult, exampleBranch] = listBranches()

Outputs

• 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
openPR(branchName)[source]

Provides a pull request URL from <branchName> to <develop> on the upstream

Usage

openPR(branchName)

Input

• branchName – Name of the branch for which a pull request (PR) shall be opened
printMsg(fileName, msg, endMsg)[source]

Print a message

Usage

printMsg(fileName, msg, endMsg)

Inputs

• fileName – Name of the file from which the message is issued
• msg – Message as string
• endMsg – End of message, generally a new line character
resetDevTools(hardReset)[source]

Reset the configuration of the development tools

Usage

resetDevTools()

Input

• hardReset – Boolean to hard reset the devTools (changes the local git configuration) (default: false)
resetLocalFork()[source]

Clean all files in the working directory and reset the fork

Usage

resetLocalFork()
submitContribution(branchName)[source]

Submit an existing branch named branchName

Usage

submitContribution(branchName)

Input

• branchName – Name of the local branch to be pushed to the git server
updateDevTools()[source]

Update the devTools and set the SSH origin if necessary

Usage

updateDevTools()
updateFork(force)[source]

Updates the fork and the submodules of the repository

Usage

updateFork(force)

Input

• force – Boolean flag to use force for updating the fork
updateSubmodules()[source]

Clones the submodules and updates the repository

Usage