Help us shape the future of Go! Take the 2026 Go Developer Survey

workspace

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package workspace checks out pull requests into isolated git worktrees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager keeps one blobless bare clone per repo under root/repos and adds a detached worktree per review under root/worktrees.

func New

func New(root string, r run.Func) *Manager

func (*Manager) Checkout

func (m *Manager) Checkout(ctx context.Context, repo string, number int, baseRef, headSHA string) (Workspace, func(), error)

Checkout fetches PR number's head and baseRef into the repo's bare clone, adds a detached worktree at headSHA, and writes the diff and commit list into a separate context dir. cleanup removes both; it is always non-nil and idempotent.

type Workspace

type Workspace struct {
	Dir         string // worktree at the PR head
	ContextDir  string // Ghost-written review materials; outside Dir so PR content can't touch it
	DiffPath    string // full diff against origin/<base>
	CommitsPath string // commits in the PR
}

Workspace is one review's checkout.

Jump to

Keyboard shortcuts

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