Ancora.Derive.ChangeSet (ancora v1.0.0)

Copy Markdown View Source

Diff-scoped change set: git diff --name-status --no-renames <base> union git status --porcelain --untracked-files=all, with serial base-blob prefetch through the run's batch port.

Summary

Functions

Computes the change set against ctx.base and prefetches every path's base blob serially through the run's batch port (or git show when no port is set).

Paths in the change set, in entry order.

Types

blob_read()

@type blob_read() :: {:ok, binary()} | :missing

entry()

@type entry() :: %{path: String.t(), status: status()}

status()

@type status() :: :added | :deleted | :modified | :untracked

t()

@type t() :: %Ancora.Derive.ChangeSet{
  entries: [entry()],
  prefetched: %{required(String.t()) => blob_read()}
}

Functions

compute(ctx)

@spec compute(Ancora.Derive.RunContext.t()) :: {:ok, t()} | {:error, term()}

Computes the change set against ctx.base and prefetches every path's base blob serially through the run's batch port (or git show when no port is set).

paths(change_set)

@spec paths(t()) :: [String.t()]

Paths in the change set, in entry order.