Resolves git-sourced extensions by cloning and updating repos.
Extensions declared with git: are cloned to a local cache directory
(~/.local/share/minga/extensions/{name}/). On first load, the repo
is cloned. On subsequent boots, the cached checkout is used as-is.
Explicit updates via SPC h e u fetch and fast-forward.
Summary
Types
Summary of available updates for a git extension.
Functions
Applies a previously fetched update by fast-forwarding the local checkout.
Returns the current HEAD ref (short hash) for a cloned extension.
Ensures the git repo is cloned locally. Returns the local path.
Returns the local cache path for a named extension.
Fetches remote changes and returns update info without applying them.
Rolls back to a specific ref after a failed update or compile.
Types
@type update_info() :: %{ name: atom(), old_ref: String.t(), new_ref: String.t(), commit_count: non_neg_integer(), branch: String.t() | nil }
Summary of available updates for a git extension.
Functions
Applies a previously fetched update by fast-forwarding the local checkout.
Returns the current HEAD ref (short hash) for a cloned extension.
@spec ensure_cloned(atom(), %{ url: String.t(), branch: String.t() | nil, ref: String.t() | nil }) :: {:ok, String.t()} | {:error, String.t()}
Ensures the git repo is cloned locally. Returns the local path.
If the cache directory already exists, returns it immediately (no
network access). If missing, clones the repo. Respects branch: and
ref: options from the git config.
Returns the local cache path for a named extension.
@spec fetch_updates(atom(), %{ url: String.t(), branch: String.t() | nil, ref: String.t() | nil }) :: {:ok, update_info()} | :up_to_date | {:error, String.t()}
Fetches remote changes and returns update info without applying them.
Returns {:ok, update_info} if there are new commits available,
:up_to_date if already current, or {:error, reason} on failure.
Rolls back to a specific ref after a failed update or compile.