Skip to main content

Module git

Module git 

Source
Expand description

Git-flow operations implemented with plain git commands.

Structs§

BranchInfo
Summary of a feature branch for the devflow list command.
GitFlow
Repository helper bound to a project root.

Enums§

AncestorStatus
Result of checking whether origin/main is already an ancestor of HEAD — i.e. whether scripts/sync-main-to-develop.sh would be a no-op — WITHOUT issuing any git fetch (20d, review: Codex HIGH — a “read-only” preflight must not depend on the network).
GitError
Errors produced by git-flow operations.
SigningStatus
Pure classification of ssh-add -l’s exit code into an actionable signing-viability status. Isolated from any I/O so it can be unit-tested for all three documented exit codes without a live agent.
SigningViability
Outcome of the tag-signing viability check. Carries only a boolean-ish status plus an optional PUBLIC key fingerprint — never private key material or a full filesystem path (T-20-04, ASVS V6 / WR-02 — mirrors the existing “no path/username” discipline this project already applies elsewhere, e.g. PhaseFinding).

Constants§

ALSO_REDIRECTING_GIT_VARS
Variables that are not repository-local — and so absent from --local-env-vars — but still redirect where git reads or writes.
REPO_LOCAL_GIT_VARS
Git’s own list of repository-local environment variables, as reported by git rev-parse --local-env-vars (15 entries on git 2.55).

Functions§

check_signing_viability
Tag-signing viability check (20d): branches on git config gpg.format since the check is a genuinely different code path per format — a GPG-only check would miss the ssh_askpass failure this project’s own release actually hit (Pattern 4). Fail-soft throughout: an absent tool or unset config degrades to an actionable SigningViability::Unknown, never a crash.
classify_ssh_add_status
Map ssh-add -l’s exit code to a SigningStatus (Pattern 4: exit 2 = no agent, 1 = agent-but-empty, 0 = keys listed).
git_command
A git command pinned to repo and stripped of every inherited variable that could redirect it somewhere else.
hermetic_command
As git_command, for a program that is not git itself but will shell out to it — cargo, whose build scripts invoke git, is the motivating case. The redirecting variables are inherited all the way down a process tree, so scrubbing only the direct git calls would leave that path open.
origin_main_ancestor_status
Check whether origin/main is an ancestor of HEAD, against ALREADY-FETCHED local refs — issues NO git fetch. Mirrors scripts/sync-main-to-develop.sh’s own git merge-base --is-ancestor origin/main HEAD invocation (:41), minus the preceding git fetch (:38), which mutates .git/FETCH_HEAD/tracking refs and would make a “read-only” preflight false (20d, review: Codex HIGH).
publish_order
Derive the crates.io publish order for a workspace’s local-path members (e.g. devflow-core before devflow) — sourced from the workspace’s own [workspace] members list and each member’s own [dependencies] section (which member depends on which), never a hardcoded prose string (20d). Read-only; returns an empty Vec (never panics) if the workspace Cargo.toml or a member manifest cannot be read.