projects

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package projects maps a bare project name to a checkout directory, for `-C r3` run from somewhere else entirely.

Off unless asked for. GH-20 fenced the binary as answering for the repo it runs in and never walking the filesystem looking for others, and a basename search over projects is exactly that walk. The fence holds because the search is opt-in: without F10_ROOTS nothing is globbed and nothing is scanned, and a bare name says so rather than guessing. Setting the variable - one line in a shell profile, no file for f10 to own - is what turns multi-project lookup on.

A path never comes here. `-C ../r3` needs no lookup at all, so it works whether or not the variable is set.

Index

Constants

View Source
const RootsEnv = "F10_ROOTS"

RootsEnv holds a colon-separated list of globs, PATH-style, each expanding to candidate checkout directories: `~/code/github.com/*/*`.

Variables

View Source
var ErrDisabled = errors.New("finding a project by name needs " + RootsEnv +
	" set to a colon-separated list of globs (for example ~/code/github.com/*/*); a path such as -C ../r3 always works")

ErrDisabled means a name was given while name lookup is off.

Functions

func All added in v0.34.0

func All() ([]string, error)

All is every checkout under the configured roots, sorted, for a command that reads every project, such as `f10 standup --all`.

func Find added in v0.26.0

func Find(name string) (string, error)

Find returns the one checkout named name under the configured roots. Nothing found and more than one found are both errors that name what was searched: a wrong guess here would run a command against the wrong repo.

func IsCheckout added in v0.34.0

func IsCheckout(dir string) bool

IsCheckout reports whether dir is a git checkout. A linked worktree carries .git as a file rather than a directory, so both count.

func IsName

func IsName(value string) bool

IsName reports whether a -C value is a project name rather than a path. Anything carrying a separator, a ~, or a leading dot is a path, and paths need none of this.

func Roots

func Roots() []string

Roots is the configured glob list, with a leading ~ expanded. Empty means name lookup is off.

Types

This section is empty.

Jump to

Keyboard shortcuts

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