types

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package types defines shared data structures used across the git-sweep application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzedBranch

type AnalyzedBranch struct {
	BranchInfo  // Embedded raw info
	IsMerged    bool
	IsOldByAge  bool
	IsProtected bool
	IsCurrent   bool // Added flag for current branch
	Category    BranchCategory
}

AnalyzedBranch contains processed branch info for UI and decisions.

type BranchCategory

type BranchCategory string

BranchCategory classifies a branch after analysis.

const (
	// CategoryProtected indicates a branch protected by config, the primary main branch, or the current branch.
	CategoryProtected BranchCategory = "Protected"
	// CategoryActive indicates a branch that is not protected, not merged, and not old.
	CategoryActive BranchCategory = "Active"
	// CategoryMergedOld indicates a branch that is merged into the primary main branch.
	CategoryMergedOld BranchCategory = "MergedOld"
	// CategoryUnmergedOld indicates a branch that is not protected, not merged, but is old based on commit date.
	CategoryUnmergedOld BranchCategory = "UnmergedOld"
)

Branch category constants.

type BranchInfo

type BranchInfo struct {
	Name           string
	Upstream       string // e.g., "origin/feature/x"
	Remote         string // e.g., "origin"
	LastCommitDate time.Time
	CommitHash     string
}

BranchInfo holds raw Git data for a local branch.

type DeleteResult

type DeleteResult struct {
	BranchName  string
	IsRemote    bool
	RemoteName  string // Only if IsRemote is true
	Success     bool
	Message     string // Success message or error details
	Cmd         string // The command attempted
	DeletedHash string // Commit hash of the branch before deletion (if successful)
}

DeleteResult holds outcome of one delete attempt.

Jump to

Keyboard shortcuts

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