loomsource

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package loomsource resolves the Loom checkout used by temporary integration modules. It keeps local-vs-remote policy consistent across transport harnesses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModePath

func ModePath(repoRoot string) (string, error)

ModePath returns the worktree-local, untracked Git metadata path used to persist source selection.

func RepositoryRoot

func RepositoryRoot(dir string) (string, error)

RepositoryRoot returns the top-level directory for the Git worktree that contains dir.

func Resolve

func Resolve(repoRoot, checkoutDir string) (string, error)

Resolve returns the checkout to place in a temporary module's Loom replace directive. LOOM_DIR overrides the persisted mode for a single invocation.

func SetMode

func SetMode(repoRoot string, mode Mode, localDir string) error

SetMode persists source selection in worktree-local Git metadata. localDir may be empty in local mode to select repoRoot.

Types

type Config

type Config struct {
	Mode     Mode
	LocalDir string
}

Config is the persisted Loom source selection for one Git worktree.

func ReadMode

func ReadMode(repoRoot string) (Config, error)

ReadMode reads source selection for the given worktree. A missing setting is remote mode so CI and fresh checkouts exercise a pushed, reproducible commit.

type Mode

type Mode string

Mode selects whether temporary modules use a local checkout or a checkout of the current commit fetched from the canonical remote.

const (
	// ModeLocal uses the configured local checkout.
	ModeLocal Mode = "local"
	// ModeRemote fetches the current commit from the canonical remote.
	ModeRemote Mode = "remote"
)

Jump to

Keyboard shortcuts

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