dmlcloud.git

Provides functions to interact with git

Functions

git_diff()

Returns the output of git diff -U0 --no-color HEAD

git_hash([short])

Returns the git hash of the current commit.

is_setuptools_cli_script(module)

Heuristically checks if the given module is a cli script generated by setuptools.

script_path()

Returns the path to the script or module that was executed.

script_directory()

Returns the directory containing the script or module that was executed.

project_directory()

Returns the top-level directory containing the script or module that was executed.

run_in_project(cmd[, stdout, stderr])

Runs a command in the project directory and returns the output.