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

track

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package track implements the stackit track command for tracking branches in a stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx *app.Context, opts Options, handler Handler) error

Action performs the track operation

Types

type Handler

type Handler interface {
	// PromptSelectParent prompts user to select a parent for the branch
	// Returns the selected parent branch name
	PromptSelectParent(ctx context.Context, eng engine.Engine, ghClient github.Client, logger output.Logger, branchName string) (string, error)

	// PromptTrackChild prompts user to confirm tracking a child branch
	// Returns true to track the child, false to skip
	PromptTrackChild(childName, parentName string) (bool, error)

	// Cleanup restores terminal state (may be no-op)
	Cleanup()

	// IsInteractive returns true if the handler supports interactive prompts
	IsInteractive() bool
}

Handler receives events from track action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed

func (*NullHandler) PromptSelectParent

func (h *NullHandler) PromptSelectParent(_ context.Context, _ engine.Engine, _ github.Client, _ output.Logger, _ string) (string, error)

PromptSelectParent implements Handler. Returns empty string for null handler.

func (*NullHandler) PromptTrackChild

func (h *NullHandler) PromptTrackChild(_, _ string) (bool, error)

PromptTrackChild implements Handler. Returns false for null handler.

type Options

type Options struct {
	BranchName string
	Force      bool
	Parent     string
}

Options contains options for the track command

Jump to

Keyboard shortcuts

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