update

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package update provides repository update orchestration and output formatting.

Index

Constants

View Source
const (
	// IconUpdated is the icon for successfully updated repositories.
	IconUpdated = "✓"
	// IconDiverged is the icon for diverged branches.
	IconDiverged = "⚠"
	// IconDirty is the icon for repositories with uncommitted changes.
	IconDirty = "⚠"
	// IconDetached is the icon for detached HEAD state.
	IconDetached = "⚠"
	// IconWarning is the icon for warning conditions.
	IconWarning = "⚠"
	// IconFailed is the icon for failed operations.
	IconFailed = "✗"
	// IconSkipped is the icon for skipped repositories.
	IconSkipped = "○"
)

Variables

This section is empty.

Functions

func FormatSuggestions

func FormatSuggestions(results []*UpdateResult) string

FormatSuggestions generates actionable suggestions for repositories needing attention.

func FormatSummary

func FormatSummary(results []*UpdateResult) string

FormatSummary generates summary counts with pterm styling.

func FormatTable

func FormatTable(results []*UpdateResult, quiet bool) (string, error)

FormatTable formats results as a styled table using pterm.

Types

type UpdateOptions

type UpdateOptions struct {
	FetchOnly  bool
	Stash      bool
	FailFast   bool
	VerifyOnly bool
	RepoFilter string
	SkipFilter string
	Quiet      bool
}

UpdateOptions contains options for the update operation.

type UpdateResult

type UpdateResult struct {
	RepoName       string
	Status         UpdateStatus
	Branch         string
	DefaultBranch  string
	CommitsBehind  int
	CommitsAhead   int
	TrackingBranch string
	Notes          string
	Error          error
}

UpdateResult represents the result of updating a single repository.

type UpdateStatus

type UpdateStatus int

UpdateStatus represents the status of a repository update operation.

const (
	// StatusUpdated indicates the repository was successfully updated.
	StatusUpdated UpdateStatus = iota

	// StatusDiverged indicates the local branch has diverged from remote.
	StatusDiverged

	// StatusDirty indicates uncommitted changes prevent update.
	StatusDirty

	// StatusDetached indicates HEAD is detached (not on any branch).
	StatusDetached

	// StatusWarning indicates a warning condition (no tracking branch, remote mismatch, etc.).
	StatusWarning

	// StatusFailed indicates the update operation failed.
	StatusFailed

	// StatusSkipped indicates the repository was skipped (not cloned, filtered out, etc.).
	StatusSkipped
)

func (UpdateStatus) String

func (s UpdateStatus) String() string

String returns a human-readable string representation of the status.

type Updater

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

Updater orchestrates repository updates.

func NewUpdater

func NewUpdater(backend git.Backend, opts UpdateOptions) *Updater

NewUpdater creates a new Updater with the given backend and options.

func (*Updater) UpdateRepository

func (u *Updater) UpdateRepository(ctx context.Context, repoName string,
	repoConfig *v2.RepositoryConfig, caproniConfig *v2.CaproniConfig) *UpdateResult

UpdateRepository performs update for a single repository.

Jump to

Keyboard shortcuts

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