Documentation
¶
Overview ¶
Package target is the project a command answers for: the checkout, its layered instructions, the probes and the effective facts, resolved once.
Index ¶
- Variables
- func CheckoutDir(sel string) (string, error)
- func CheckoutFlags(cmd *cli.Command) []string
- func ExpandHome(path string) (string, error)
- func LabeledErrors(problems []facts.Problem) string
- func RootDir(cmd *cli.Command) (string, bool, error)
- type Target
- func (t *Target) BranchReference(ctx context.Context, explicit string) (ref.Ref, error)
- func (t *Target) Driver() *trackerdriver.Driver
- func (t *Target) DriverPaths() []string
- func (t *Target) HostCloses() bool
- func (t *Target) HostIssues() bool
- func (t *Target) IDOf(ctx context.Context) func(string) string
- func (t *Target) LoreRoot() string
- func (t *Target) OutOfTree() bool
- func (t *Target) RefProject(ctx context.Context) string
- func (t *Target) Reference(ctx context.Context, explicit string) (ref.Ref, error)
- func (t *Target) TrackerDeclared() bool
Constants ¶
This section is empty.
Variables ¶
var ProjectOf = func(ctx context.Context, dir string) string { return ledger.Where(ctx, dir).Project }
ProjectOf is the ledger's project id for dir. A var, so tests that fake git leave the task refs alone.
Functions ¶
func CheckoutDir ¶
CheckoutDir sends a bare name to projects, which is off until the user turns it on; a path needs no lookup.
func CheckoutFlags ¶
func ExpandHome ¶
func LabeledErrors ¶
LabeledErrors marks each of the project's problems with project.md; a problem in the user's ~/.f10 files names its own file already.
Types ¶
type Target ¶
type Target struct {
Dir string
Layout *layout.Layout
Probes *probe.Probes
Effective *facts.Effective
// contains filtered or unexported fields
}
A Target is the project a command answers for; -C only changes which checkout it describes, which is the whole of cross-project support.
func (*Target) BranchReference ¶
BranchReference is Reference without the session's task: the branch's task or none, because a findings key, a commit's trailers and a merge follow the checkout, never what this session last ran. Under -C the branch is that checkout's own, so it answers there too.
func (*Target) Driver ¶
func (t *Target) Driver() *trackerdriver.Driver
func (*Target) DriverPaths ¶
DriverPaths, in lookup order: this checkout's own, then beside each instruction layer, last first, so a worktree finds main's driver where it finds main's instructions and one replacing them keeps main's driver out.
func (*Target) HostCloses ¶
HostCloses reports that the host's issues are the tracker, so a merge's closing keyword closes the task; a driver's tracker is never closed that way.
func (*Target) HostIssues ¶
func (*Target) IDOf ¶
IDOf turns a task as typed (`117`, a url) into its id, a token that names no task kept as typed. Lookups may start git and every finish row asks, so each token is looked up once, safely across concurrent readers.
func (*Target) LoreRoot ¶
LoreRoot is where the project's lore lives: the checkout's committed .lore, else the storage root's, which every checkout shares.
func (*Target) OutOfTree ¶
OutOfTree says the storage root is ~/.f10/<project>, outside every checkout.
func (*Target) RefProject ¶
RefProject is the ledger's project id for this target, read once: status and drive write refs for every task they show.
func (*Target) Reference ¶
Reference looks up a task for this target. Under -C the cascade collapses: the branch and the session task answer for *this* checkout, so pointing at another project means saying which task.