Minga.Git.Repo.Profile (Minga v0.1.0)

Copy Markdown View Source

Runtime policy for repo-wide git refreshes.

The profile is deliberately cheap to build. Ambient editor features use it to avoid expensive status modes in sparse or user-overridden huge repos.

Summary

Functions

Returns true when this profile still enumerates untracked files (:normal).

Builds the ambient git policy for git_root.

Returns the absolute path of the sole sparse-checkout leaf cone directory, or nil.

Types

size_class()

@type size_class() :: :unknown | :large | :huge

t()

@type t() :: %Minga.Git.Repo.Profile{
  size_class: size_class(),
  sparse?: boolean(),
  timeout_ms: pos_integer(),
  untracked_mode: Minga.Git.untracked_mode()
}

Functions

degrades_visibly?(profile)

@spec degrades_visibly?(t()) :: boolean()

Returns true when this profile still enumerates untracked files (:normal).

A status timeout on such a profile means results were trimmed while untracked files were in scope, so the omission must be surfaced as degraded (AC 2/5). Sparse / :no profiles deliberately omit untracked files, so a timeout there is not a visibility regression worth flagging.

detect(git_root)

@spec detect(String.t()) :: t()

Builds the ambient git policy for git_root.

single_cone_dir(git_root)

@spec single_cone_dir(String.t()) :: String.t() | nil

Returns the absolute path of the sole sparse-checkout leaf cone directory, or nil.

In cone mode the sparse-checkout file lists each included directory as a /dir/ line, alongside the /* and !/*/ preamble that keeps root files and excludes everything else. Parent scaffolding lines such as !/apps/*/ are ignored, so a nested checkout like apps/web resolves to the leaf cone only. Any non-empty line outside those cone forms makes the file non-cone, so callers keep git-root / nearest-marker behavior.