csdms

bmibabel.git module

Git-related utility functions.

bmibabel.git.git_clone(url, git=None, dir='.', branch='master')[source]

Clone a git repository.

Parameters:

url : str

URL of a git repository.

git : str, optional

Path to the git program.

dir : str, optional

Path to a folder to clone into.

branch : str, optional

Branch of the git repository.

bmibabel.git.git_clone_or_update(url, dir='.', branch='master', git=None)[source]

Clone (or update) a git repository .

If the repository doesn’t not exists locally, clone it from url. Otherwise, simply update it.

Parameters:

url : str

URL of a git repository.

git : str, optional

Path to the git program.

dir : str, optional

Path to a folder that contains the git repository.

branch : str, optional

Branch of the git repository.

bmibabel.git.git_pull(dir='.', branch='master', git=None)[source]

Pull from a git repository.

Parameters:

git : str, optional

Path to the git program.

dir : str, optional

Path to a folder that contains the git repository.

branch : str, optional

Branch of the git repository.

bmibabel.git.git_repo_name(url)[source]

Get the name of a git repository.

Parameters:

url : str

URL of a git repository.

Returns:

str

Name of the repository.

bmibabel.git.git_repo_sha(url, git=None, branch='master')[source]

Get the SHA for a git repository.

Parameters:

url : str

URL of a git repository.

git : str, optional

Path to the git program.

branch : str, optional

Branch of the git repository.

Returns:

str

First 10 characters of the SHA.

bmibabel.git.is_sha1(string)[source]

Test if a string is a SHA1.

Parameters:

string : str

String to test.

Returns:

boolean

True if the string is a valid SHA1. Otherwise, False.