Skip to main content

Crate vcs_runner

Crate vcs_runner 

Source
Expand description

VCS-specific helpers built on procpilot. Adds jj/git shorthand wrappers, repo detection, and output parsers.

For generic subprocess execution (stdin, retry, timeout, custom envs), use procpilot::Cmd directly — it’s re-exported here for convenience.

Modules§

prelude
Common types and helpers for everyday VCS subprocess work.

Structs§

Bookmark
A jj bookmark with sync status.
BookmarkParseResult
Result of parsing bookmark output, including any skipped entries.
Cmd
Builder for a subprocess invocation or pipeline.
CmdDisplay
Owned snapshot of a command’s program + args, formatted shell-style on Display. For pipelines, renders each stage separated by |.
DefaultRunner
Default Runner that delegates to Cmd::run.
FileChange
A single file change in a diff summary.
GitRemote
A git remote.
LogEntry
A jj log entry parsed from jj template JSON output.
LogParseResult
Result of parsing log output, including any skipped entries.
RetryPolicy
How retries are scheduled and which errors trigger them.
RunOutput
Captured output from a successful command.
SpawnedProcess
Handle to one or more spawned subprocesses (a single command or a pipeline).

Enums§

ConflictState
Whether a jj commit has unresolved conflicts.
ContentState
Whether a jj commit is empty (no file changes).
FileChangeKind
The kind of change a file underwent in a diff.
Redirection
Where a child process’s stdout or stderr goes.
RemoteStatus
Sync status of a bookmark relative to its remote.
RunError
Error type for subprocess execution.
StdinData
Input data to feed to a child process’s stdin.
VcsBackend
Which version control system is managing a directory.
WorkingCopy
Whether a jj commit is the current working copy.

Constants§

BOOKMARK_TEMPLATE
jj template for jj bookmark list producing line-delimited JSON.
LOG_TEMPLATE
jj template for jj log producing line-delimited JSON entries.
STREAM_SUFFIX_SIZE
Maximum bytes of stdout/stderr retained on NonZeroExit and Timeout error variants. Anything beyond this is dropped from the front (FIFO), keeping the most recent output — usually the most relevant for debugging.

Traits§

Runner
Pluggable backend for executing a Cmd. See the module-level docs.

Functions§

binary_available
Check whether a binary is available on PATH.
binary_version
Return a binary’s --version output, if available.
default_transient
Default transient-error predicate.
detect_vcs
Detect the VCS backend for a path, without running any subprocesses.
git_available
Check whether the git binary is available on PATH.
git_merge_base
Find the merge base of two revisions in a git repository.
git_version
Get the git version string, if available.
is_transient_error
Default transient-error check for jj/git.
jj_available
Check whether the jj binary is available on PATH.
jj_merge_base
Find the merge base of two revisions in a jj repository.
jj_version
Get the jj version string, if available.
parse_bookmark_output
Parse jj bookmark list --template BOOKMARK_TEMPLATE output.
parse_diff_summary
Parse jj diff --summary output into structured FileChange values.
parse_git_diff_name_status
Parse git diff --name-status output into structured FileChange values.
parse_log_output
Parse jj log --template LOG_TEMPLATE output.
parse_remote_list
Parse jj git remote list output into GitRemote values.
run_git
Run a git command in a repo directory, returning captured output.
run_git_utf8
Run a git command, returning lossy-decoded, trimmed stdout as a String.
run_git_utf8_with_retry
Run a git command with retry, returning trimmed stdout as a String.
run_git_utf8_with_timeout
Run a git command with a timeout, returning trimmed stdout as a String.
run_git_with_retry
Run a git command with retry on transient errors.
run_git_with_timeout
Run a git command with a timeout.
run_jj
Run a jj command in a repo directory, returning captured output.
run_jj_utf8
Run a jj command, returning lossy-decoded, trimmed stdout as a String.
run_jj_utf8_with_retry
Run a jj command with retry, returning trimmed stdout as a String.
run_jj_utf8_with_timeout
Run a jj command with a timeout, returning trimmed stdout as a String.
run_jj_with_retry
Run a jj command with retry on transient errors.
run_jj_with_timeout
Run a jj command with a timeout.