Skip to main content

Module git_version

Module git_version 

Source
Expand description

The Git version check run once before work that depends on Git’s behavior. What: The real Git version check, run once per invocation before work that depends on Git’s behavior: a commit, hooks and locks. Why: The native tables and protocols follow Git 2.56.0, and the owner settled on 2.55.0 as the oldest release that runs the swap, so 2.55.0 or newer counts as supported and that read-only commands are never checked (doc/handover/cli-git-rust-implementation.md, “Adopted without a question”).

In TS you’d write (pseudocode):

await requireSupportedGit({ gitPath }); // once

Constants§

MINIMUM_GIT_VERSION
The oldest supported Git release.

Functions§

ask_git_version
What: Ask Git its version and decide support, without the cache. Why: check_git_version remembers this answer.
check_git_version
What: Require a supported Git, asking at most once per process. Why: The check costs a Git process, so later dependent steps reuse the answer.
check_once
What: Return the answer already stored in cell, or ask once and store the answer. Why: check_git_version keeps one answer per process; a separate cell lets the controls prove the ask runs once without sharing the process-wide answer.
parse_git_version
What: The release numbers of git version output, such as git version 2.56.0.windows.1. Why: Only the first three dotted numbers decide support; platform suffixes vary.
unsupported_message
What: The message for an unsupported or unreadable Git. Why: The person must know which Git was asked and what to do.

Type Aliases§

GitRelease
A Git release as its major, minor and patch numbers.