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.

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§

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.
ref_is_ancestor
Whether the ancestor ref is an ancestor of the descendant ref, against ALREADY-FETCHED local refs — issues NO git fetch. Generalises origin_main_ancestor_status to an arbitrary ref pair (used by release --verify’s post-cut checks: is the release tag on main, and has the maindevelop sync run). Distinguishes “not an ancestor” (exit 1) from “a ref is absent” (exit 128) so the caller can degrade to an actionable git fetch message instead of reporting a false divergence.