Skip to main content

Module git

Module git 

Source

Structsยง

GitConfig

Enumsยง

PathFreshness
Represents the result of checking whether a set of paths have been modified locally or not.

Functionsยง

changes_since
Returns true if any of the passed paths have changed since the base commit.
check_path_modifications
This function figures out if a set of paths was last modified upstream or if there are some local modifications made to them. It can be used to figure out if we should download artifacts from CI or rather build them locally.
escape_email_git_regex ๐Ÿ”’
Escape characters from the git user e-mail, so that git commands do not interpret it as regex special characters.
get_closest_upstream_commit
Returns the most recent (ordered chronologically) commit found in the local history that should exist upstream. We identify upstream commits by the e-mail of the commit author.
get_git_modified_files
Returns the files that have been modified in the current branch compared to the master branch. This includes committed changes, uncommitted changes, and changes that are not even staged.
get_git_untracked_files
Returns the files that havenโ€™t been added to git yet.
get_latest_upstream_commit_that_modified_files ๐Ÿ”’
Returns the latest upstream commit that modified target_paths, or None if no such commit was found.
output_result
Runs a command and returns the output
resolve_commit_sha ๐Ÿ”’
Resolve the commit SHA of commit_ref.
run_git_diff_index ๐Ÿ”’
diff-index can return outdated information, because it does not update the git index. This function uses update-index to update the index first, and then provides func with a command prepared to run git diff-index.