runner

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package runner executes VCS or shell commands across multiple repos in parallel, streaming results back through a channel as each completes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	concurrency int64,
) <-chan Result

Diff runs `git diff` or `jj diff` for each repo, streaming one Result per repo to the returned channel.

func Dispatch

func Dispatch(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	backendName string,
	args []string,
	concurrency int64,
) (<-chan Result, error)

Dispatch runs args via backendName across the given repos, streaming one Result per repo to the returned channel. The channel is closed when all goroutines finish. The caller should drain the channel before inspecting the returned error (which reflects infrastructure failures only).

func GatherStatus

func GatherStatus(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	concurrency int64,
) <-chan StatusResult

GatherStatus fetches the VCS status for each repo concurrently, streaming one StatusResult per repo to the returned channel.

func Shell

func Shell(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	shellCmd string,
	concurrency int64,
) <-chan Result

Shell runs an arbitrary shell command across repos. It does not route through a backend; it uses sh -c directly.

func Status

func Status(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	concurrency int64,
) <-chan Result

Status runs `git status` or `jj status` for each repo, streaming one Result per repo to the returned channel.

func VCS

func VCS(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	subcmd string,
	concurrency int64,
) <-chan Result

VCS runs `<vcs> <subcmd>` (e.g. `git status`, `jj diff`) for each repo, streaming one Result per repo to the returned channel. The VCS binary is determined per-repo from its active backend.

func VCSArgs

func VCSArgs(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	subcmd string,
	args []string,
	concurrency int64,
) <-chan Result

VCSArgs runs `<vcs> <subcmd> <args>...` for each repo.

Types

type Result

type Result struct {
	RepoName string
	RepoPath string
	VCS      string
	Output   string
	ExitCode int
	Err      error
}

Result is the outcome for a single repo, sent through the results channel.

type StatusResult

type StatusResult struct {
	RepoName string
	RepoPath string
	VCS      string
	Status   backend.RepoStatus
	Err      error
}

StatusResult carries the live status for a single repo used by `ll`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL