Apero.Git (Apero v2.1.0)

Copy Markdown View Source

Git utilities for repository management, configuration and synchronisation.

Submodules

This module is a facade that delegates to Apero.Git.Local for local operations.

Remote APIs (REMOVED)

The following functions have been removed from this module as they belong in specialized GitHub/GitLab clients:

  • create_gh_pr/4 — Use a dedicated GitHub client library instead
  • create_glab_mr/4 — Use a dedicated GitLab client library instead
  • list_issues/2 — Use a dedicated GitHub client library instead

Security

All user-supplied values (commit messages, branch names, file paths) are passed as argument lists — never interpolated into shell strings — to prevent shell injection attacks.

Summary

Functions

Checks if the GitHub CLI (gh) is available.

Checks if the GitLab CLI (glab) is available.

Functions

add(repo_path, files)

This function is deprecated. Use Apero.Git.Local.add/2 instead.
@spec add(binary(), :all | [binary()] | binary()) ::
  :ok | {:ok, binary()} | {:error, any()}

See Apero.Git.Local.add/2.

blame(repo_path, file)

This function is deprecated. Use Apero.Git.Local.blame/2 instead.
@spec blame(binary(), binary()) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.blame/2.

branch_exists?(branch)

This function is deprecated. Use Apero.Git.Local.branch_exists?/1 instead.
@spec branch_exists?(binary()) :: boolean()

See Apero.Git.Local.branch_exists?/1.

checkout(repo)

This function is deprecated. Use Apero.Git.Local.checkout/1 instead.
@spec checkout(map()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.checkout/1.

churn(repo_path \\ ".", opts \\ [])

This function is deprecated. Use Apero.Git.Local.churn/2 instead.
@spec churn(
  binary(),
  keyword()
) :: {:ok, [map()]} | {:error, binary()}

See Apero.Git.Local.churn/2.

clone(repo)

This function is deprecated. Use Apero.Git.Local.clone/1 instead.
@spec clone(map()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.clone/1.

clone_repository(url, target_path)

This function is deprecated. Use Apero.Git.Local.clone_repository/2 instead.
@spec clone_repository(binary(), binary()) :: {:ok, binary()} | {:error, any()}

See Apero.Git.Local.clone_repository/2.

commit(repo, message)

This function is deprecated. Use Apero.Git.Local.commit/2 instead.
@spec commit(map(), binary()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.commit/2.

config(attr)

This function is deprecated. Use Apero.Git.Local.config/1 instead.
@spec config(binary()) :: binary()

See Apero.Git.Local.config/1.

config_global(attr)

This function is deprecated. Use Apero.Git.Local.config_global/1 instead.
@spec config_global(binary()) :: binary()

See Apero.Git.Local.config_global/1.

config_local(attr)

This function is deprecated. Use Apero.Git.Local.config_local/1 instead.
@spec config_local(binary()) :: binary()

See Apero.Git.Local.config_local/1.

conflict_files(repo_path \\ ".")

This function is deprecated. Use Apero.Git.Local.conflict_files/1 instead.
@spec conflict_files(binary()) :: {:ok, [binary()]} | {:error, binary()}

See Apero.Git.Local.conflict_files/1.

diff(repo_path \\ ".", opts \\ [])

This function is deprecated. Use Apero.Git.Local.diff/2 instead.
@spec diff(
  binary(),
  keyword()
) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.diff/2.

ensure_clone(atom)

This function is deprecated. Use Apero.Git.Local.ensure_clone/2 instead.
@spec ensure_clone(nil) :: {:error, :no_repo_defined}

See Apero.Git.Local.ensure_clone/2.

ensure_clone(repos, workspace_path)

@spec ensure_clone([map()], binary()) :: [
  {:repo_exists | :repo_cloned, map()} | {:repo_error, map(), term()}
]
@spec ensure_clone(map(), binary()) ::
  {:repo_exists | :repo_cloned, map()} | {:repo_error, map(), term()}

existing_repos(repos)

This function is deprecated. Use Apero.Git.Local.existing_repos/1 instead.
@spec existing_repos([tuple()]) :: binary()

See Apero.Git.Local.existing_repos/1.

fetch(repo)

This function is deprecated. Use Apero.Git.Local.fetch/1 instead.
@spec fetch(map()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.fetch/1.

fetch_origin(repo_path)

This function is deprecated. Use Apero.Git.Local.fetch_origin/1 instead.
@spec fetch_origin(binary()) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.fetch_origin/1.

get_current_branch(repo_path)

This function is deprecated. Use Apero.Git.Local.get_current_branch/1 instead.
@spec get_current_branch(binary()) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.get_current_branch/1.

get_git_user_email()

This function is deprecated. Use Apero.Git.Local.get_git_user_email/0 instead.
@spec get_git_user_email() :: binary() | nil

See Apero.Git.Local.get_git_user_email/0.

get_git_user_name()

This function is deprecated. Use Apero.Git.Local.get_git_user_name/0 instead.
@spec get_git_user_name() :: binary() | nil

See Apero.Git.Local.get_git_user_name/0.

get_hostname()

This function is deprecated. Use Apero.Git.Local.get_hostname/0 instead.
@spec get_hostname() :: binary()

See Apero.Git.Local.get_hostname/0.

get_system_user_email()

This function is deprecated. Use Apero.Git.Local.get_system_user_email/0 instead.
@spec get_system_user_email() :: binary()

See Apero.Git.Local.get_system_user_email/0.

get_system_user_name()

This function is deprecated. Use Apero.Git.Local.get_system_user_name/0 instead.
@spec get_system_user_name() :: binary()

See Apero.Git.Local.get_system_user_name/0.

get_user_info()

This function is deprecated. Use Apero.Git.Local.get_user_info/0 instead.
@spec get_user_info() :: map()

See Apero.Git.Local.get_user_info/0.

gh_available?()

@spec gh_available?() :: boolean()

Checks if the GitHub CLI (gh) is available.

glab_available?()

@spec glab_available?() :: boolean()

Checks if the GitLab CLI (glab) is available.

has_stash?(repo_path)

This function is deprecated. Use Apero.Git.Local.has_stash?/1 instead.
@spec has_stash?(binary()) :: boolean()

See Apero.Git.Local.has_stash?/1.

has_uncommitted_changes?(repo_path)

This function is deprecated. Use Apero.Git.Local.has_uncommitted_changes?/1 instead.
@spec has_uncommitted_changes?(binary()) :: boolean()

See Apero.Git.Local.has_uncommitted_changes?/1.

log(repo_path \\ ".", opts \\ [])

This function is deprecated. Use Apero.Git.Local.log/2 instead.
@spec log(
  binary(),
  keyword()
) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.log/2.

mark_resolved(repo_path, file)

This function is deprecated. Use Apero.Git.Local.mark_resolved/2 instead.
@spec mark_resolved(binary(), binary()) :: :ok | {:error, binary()}

See Apero.Git.Local.mark_resolved/2.

merge_abort(repo_path \\ ".")

This function is deprecated. Use Apero.Git.Local.merge_abort/1 instead.
@spec merge_abort(binary()) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.merge_abort/1.

pull(repo)

This function is deprecated. Use Apero.Git.Local.pull/1 instead.
@spec pull(map()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.pull/1.

pull_origin(repo_path, branch \\ "main")

This function is deprecated. Use Apero.Git.Local.pull_origin/2 instead.
@spec pull_origin(binary(), binary()) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.pull_origin/2.

set_user_info(name, email)

This function is deprecated. Use Apero.Git.Local.set_user_info/2 instead.
@spec set_user_info(binary(), binary()) :: :ok

See Apero.Git.Local.set_user_info/2.

setup_credentials(opts \\ [])

This function is deprecated. Use Apero.Git.Local.setup_credentials/1 instead.
@spec setup_credentials(keyword()) :: :ok | {:error, binary()}

See Apero.Git.Local.setup_credentials/1.

stage_and_commit(repo, message)

This function is deprecated. Use Apero.Git.Local.stage_and_commit/2 instead.
@spec stage_and_commit(map(), binary()) :: {:ok, map()} | {:error, any()}

See Apero.Git.Local.stage_and_commit/2.

stash_if_needed(repo_path)

This function is deprecated. Use Apero.Git.Local.stash_if_needed/1 instead.
@spec stash_if_needed(binary()) ::
  {:ok, {:stashed, binary()} | :clean} | {:error, any()}

See Apero.Git.Local.stash_if_needed/1.

stash_push(repo_path, opts \\ [])

This function is deprecated. Use Apero.Git.Local.stash_push/2 instead.
@spec stash_push(
  binary(),
  keyword()
) :: {:ok, binary()} | {:error, binary()}

See Apero.Git.Local.stash_push/2.

sync(repos)

This function is deprecated. Use Apero.Git.Local.sync/1 instead.
@spec sync([map()] | map()) :: :ok | {:ok, map()} | {:error, any()}

See Apero.Git.Local.sync/1.

update_existing_repository(repo_path)

This function is deprecated. Use Apero.Git.Local.update_existing_repository/1 instead.
@spec update_existing_repository(binary()) :: {:ok, binary()} | {:error, any()}

See Apero.Git.Local.update_existing_repository/1.