GitOps.Git (Git Ops v2.11.0)
View SourceHelper functions for working with Git and fetching the tags/commits we care about.
Summary
Functions
The subject line of a commit.
Commits files (a map of repo-relative path to contents) on top of
base_ref using a temporary index, leaving the working tree untouched.
Returns the new commit's SHA.
First-parent commit SHAs of HEAD that touch path, newest first.
The name of the currently checked out branch.
Commit info since a tag (or all commits), newest first.
Force-pushes a commit or tag ref to origin.
The tag names present on the origin remote, or the local tags when there
is no reachable remote.
The contents of path at ref, or :error if it does not exist there.
All tags starting with prefix, newest version first.
Types
Functions
@spec add!(Git.Repository.t(), [String.t()]) :: String.t()
@spec commit!(Git.Repository.t(), [String.t()]) :: String.t()
@spec commit_subject!(Git.Repository.t(), String.t()) :: String.t()
The subject line of a commit.
@spec commit_tree!( Git.Repository.t(), String.t(), %{required(String.t()) => String.t()}, String.t() ) :: String.t()
Commits files (a map of repo-relative path to contents) on top of
base_ref using a temporary index, leaving the working tree untouched.
Returns the new commit's SHA.
@spec commits_touching!(Git.Repository.t(), String.t(), pos_integer()) :: [String.t()]
First-parent commit SHAs of HEAD that touch path, newest first.
@spec current_branch!(Git.Repository.t()) :: String.t()
The name of the currently checked out branch.
@spec get_commit_info(Git.Repository.t(), String.t() | :all, Keyword.t()) :: [ commit_info() ]
Commit info since a tag (or all commits), newest first.
Options:
:paths- pathspecs restricting which commits count (git pathspec syntax, so:^direntries exclude).:first_parent- follow only the first parent of merge commits.
@spec hooks_path(Git.Repository.t()) :: String.t() | no_return()
@spec init!(String.t()) :: Git.Repository.t()
@spec parse_git_log(String.t()) :: [commit_info()]
@spec push!(Git.Repository.t(), String.t(), String.t()) :: :ok
Force-pushes a commit or tag ref to origin.
@spec remote_tags(Git.Repository.t()) :: MapSet.t(String.t())
The tag names present on the origin remote, or the local tags when there
is no reachable remote.
@spec show(Git.Repository.t(), String.t(), String.t()) :: {:ok, String.t()} | :error
The contents of path at ref, or :error if it does not exist there.
@spec tag!(Git.Repository.t(), String.t() | [String.t()]) :: String.t()
@spec tag_exists?(Git.Repository.t(), String.t()) :: boolean()
@spec tags(Git.Repository.t()) :: [String.t()]
@spec tags(Git.Repository.t(), String.t()) :: [String.t()]
All tags starting with prefix, newest version first.
Unlike tags/1, returns an empty list when nothing matches, so callers can
treat "never released" as a normal state.