ci_diff_helper.git_tools module¶
Helpers for interacting with git.
-
ci_diff_helper.git_tools.commit_subject(revision='HEAD')[source]¶ Gets the subject of a
gitcommit.Parameters: revision ( Optional[str]) – Agitrevision, any of a branch name, tag, a commit SHA or a special reference.Returns: The commit subject. Return type: str
-
ci_diff_helper.git_tools.get_checked_in_files()[source]¶ Gets a list of files in the current
gitrepository.Effectively runs:
$ git ls-files ${GIT_ROOT}
and then finds the absolute path for each file returned.
Returns: List of all filenames checked into. Return type: list
-
ci_diff_helper.git_tools.git_root()[source]¶ Return the root directory of the current
gitcheckout.Returns: Filesystem path to gitcheckout root.Return type: str
-
ci_diff_helper.git_tools.merge_commit(revision='HEAD')[source]¶ Checks if a
gitrevision is a merge commit.Parameters: revision ( Optional[str]) – Agitrevision, any of a branch name, tag, a commit SHA or a special reference.Returns: Flag indicating if the given revision. Return type: bool Raises: NotImplementedError– if the number of parents is not 1 or 2.