flowbber.utils.git

Utilities for git repositories.

Functions

flowbber.utils.git.find_git()

Find the git executable.

Returns
Absolute path to the git executable.
Return type
str
flowbber.utils.git.find_tag(git=None, directory='.')

Find the tag for the current revision.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The name of the tag pointing to the current revision. Raises GitError if no tag is found.

Return type

str

flowbber.utils.git.find_root(git=None, directory='.')

Find the root of the git repository.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

Absolute path to root of the git repository.

Return type

str

flowbber.utils.git.find_branch(git=None, directory='.')

Find the current branch of the git repository.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The name of the branch the git repository is currently on.

Return type

str

flowbber.utils.git.find_revision(git=None, directory='.')

Find the current revision (short hash) of the git repository.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The short version of the revision the git repository is currently on.

Return type

str

flowbber.utils.git.find_name(git=None, directory='.')

Find the name of the author of the current revision.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The name of the author of the current revision.

Return type

str

flowbber.utils.git.find_email(git=None, directory='.')

Email of the author of the current revision.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The email of the author of the current revision.

Return type

str

flowbber.utils.git.find_subject(git=None, directory='.')

Commit message subject of current revision.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The commit message subject of current revision.

Return type

str

flowbber.utils.git.find_body(git=None, directory='.')

Commit message body of current revision.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The commit message body of current revision.

Return type

str

flowbber.utils.git.find_date(git=None, directory='.')

Commit date in strict ISO 8601 format.

Parameters
  • git (str) – Path to git executable. If None, the default, will try to find it using find_git().
  • directory (str) – Run as if git was started in directory instead of the current working directory.
Returns

The commit date in strict ISO 8601 format.

Return type

str