Runtime Module
Functions invoked from erased quotations - these run in the *consuming* program, not in the compiler, and must never throw.
Types
| Type | Description |
|
|
Functions and values
| Function or value |
Description
|
Full Usage:
commitsAhead workTree baseRef headRef
Parameters:
string
baseRef : string
headRef : string
Returns: int
|
Commits reachable from `headRef` but not from `baseRef`. Returns 0 when git is unavailable, either ref is missing, or the call times out.
|
Full Usage:
commitsAheadOfUpstream workTree gitDir commonDir
Parameters:
string
gitDir : string
commonDir : string
Returns: int
|
Commits in HEAD not yet pushed to the configured upstream branch. Returns 0 when HEAD is detached, no upstream is configured, or git is unavailable.
|
Full Usage:
commitsBehind workTree baseRef headRef
Parameters:
string
baseRef : string
headRef : string
Returns: int
|
Commits reachable from `baseRef` but not from `headRef`. Inverse of `commitsAhead`.
|
Full Usage:
commitsBehindUpstream workTree gitDir commonDir
Parameters:
string
gitDir : string
commonDir : string
Returns: int
|
Commits in the configured upstream branch not yet merged into HEAD. Returns 0 when HEAD is detached, no upstream is configured, or git is unavailable.
|
Full Usage:
exec workTree args
Parameters:
string
args : string
Returns: string
|
Escape hatch for arbitrary read-only git commands. Returns "" on failure.
|
Full Usage:
headBranch gitDir
Parameters:
string
Returns: string
|
The checked-out branch name, or "" when HEAD is detached.
|
Full Usage:
headBranchIsAvailable gitDir commonDir
Parameters:
string
commonDir : string
Returns: bool
|
Whether HEAD identifies a branch with a commit available to inspect.
|
Full Usage:
headIsAvailable gitDir commonDir
Parameters:
string
commonDir : string
Returns: bool
|
Whether HEAD currently resolves to a commit.
|
Full Usage:
headSha gitDir commonDir
Parameters:
string
commonDir : string
Returns: string
|
The sha HEAD resolves to. "" in a repository with no commits yet.
|
Full Usage:
isAvailable ()
Parameters:
unit
Returns: bool
|
Whether a usable `git` is on PATH in the consuming environment.
|
Full Usage:
isDetached gitDir
Parameters:
string
Returns: bool
|
|
Full Usage:
isDirty workTree
Parameters:
string
Returns: bool
|
True when the working tree or index has changes.
|
Full Usage:
latestTag workTree
Parameters:
string
Returns: string
|
The nearest ancestor tag reachable from HEAD, via `git describe --tags --abbrev=0`. Returns "" when no tags are reachable or git is unavailable.
|
|
Revision details for the nearest ancestor tag. Returns the empty record when no tag is reachable.
|
Full Usage:
latestTagRevisionDetails workTree expression
Parameters:
string
expression : string
Returns: RevisionDetails
|
Revision details for the given expression relative to the nearest ancestor tag. Returns the empty record when no tag is reachable.
|
Full Usage:
resolveRef commonDir refName
Parameters:
string
refName : string
Returns: string
|
Resolves a ref name such as `refs/heads/main` to a sha, following symbolic refs. Returns "" when the ref no longer exists.
|
Full Usage:
resolveRevision workTree baseRef expression
Parameters:
string
baseRef : string
expression : string
Returns: string
|
Resolves a git revision expression to a commit SHA. Returns an empty string when the expression is unavailable or does not name a commit.
|
Full Usage:
revisionDetails workTree baseRef expression
Parameters:
string
baseRef : string
expression : string
Returns: RevisionDetails
|
Reads the commit identity and display metadata in one git invocation. The result is cached because each generated property may be accessed independently by a consuming build script.
|
Full Usage:
revisionExpression baseRef expression
Parameters:
string
expression : string
Returns: string
|
Applies a revision suffix to a ref. A leading `~` or `^` is interpreted relative to the generated branch, while all other expressions are passed to git as written.
|
Full Usage:
shortRevision workTree baseRef expression
Parameters:
string
baseRef : string
expression : string
Returns: string
|
Resolves a git revision expression to a seven-character display SHA.
|
Full Usage:
tryExec workTree args
Parameters:
string
args : string
Returns: string option
|
|
Full Usage:
tryExecTimeout timeoutMs workTree args
Parameters:
int
workTree : string
args : string
Returns: string option
|
Runs `git` in `workTree`, returning trimmed stdout on success and `None` on failure, non-zero exit, timeout, or a missing `git`.
|
Partas.TypeProvider