exa.common.helpers.software_version_helper.get_vcs_description

exa.common.helpers.software_version_helper.get_vcs_description#

get_vcs_description(root_directory)#

Get Version Control System (VCS) description for the caller’s current working directory.

The description is used to verify if a directory is installed under VCS and whether changes to the files have been made. First, the existence of .git directory will be checked from root_directory. Only if it exists, a git command is executed in a subprocess with a timeout of 1 seconds as the best effort only.

root_directory#

The path to the directory where the command will be executed. For instance when called from exa-experiment, it can be the exa-experiment root directory or any directory under it.

Returns:

If root_directory is not installed under git, None will be returned. Otherwise, the output of git describe --dirty --tags --long is returned. In case of errors in executing the command, the caught subprocess.CalledProcessError will be converted to string and returned.

Raises:

If the command fails or timeouts, an exception will be raised directly from subprocess.check_output.

Parameters:

root_directory (str) –

Return type:

str | None