Documentation
¶
Index ¶
- func Execute() error
- func SetVersion(v string)
- type Action
- type AheadBehindCount
- type BranchInfo
- type ChangedFile
- type Config
- type DiffChange
- type DiffHunk
- type DiffLine
- type DiffMode
- type DiffModeView
- type DiffView
- type FileListView
- type InputConfig
- type Key
- type KeyInput
- type LineType
- type MergeConflictResult
- type MultiSelectItem
- type Option
- type Session
- type UntrackedFile
- type ViewAction
- type WIPChanges
- type WorktreeChanges
- type WorktreeInfo
- type WorktreeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVersion ¶ added in v0.3.3
func SetVersion(v string)
SetVersion sets the version for the CLI (called from main with ldflags value)
Types ¶
type Action ¶
type Action struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Script string `yaml:"script"`
Condition string `yaml:"condition,omitempty"` // Shell command, runs if exit 0
Input *InputConfig `yaml:"input,omitempty"`
}
Action represents a new or remove action
type AheadBehindCount ¶
AheadBehindCount represents commits ahead/behind remote
type BranchInfo ¶ added in v0.3.5
BranchInfo holds metadata about a branch for display and selection
type ChangedFile ¶ added in v0.3.4
type ChangedFile struct {
Path string // File path relative to repo root
Status string // M=Modified, A=Added, D=Deleted, R=Renamed, C=Copied
OldPath string // For renames/copies, the original path
}
ChangedFile represents a file that has been modified, added, or deleted
type Config ¶
type Config struct {
New []Action `yaml:"new,omitempty"`
Remove []Action `yaml:"remove,omitempty"`
}
Config represents the .git-wt.yaml configuration
type DiffChange ¶ added in v0.3.4
type DiffChange struct {
OldStart int // Starting line in old file (1-based)
OldCount int // Number of lines affected in old file
NewStart int // Starting line in new file (1-based)
NewCount int // Number of lines affected in new file
}
DiffChange represents a change identified from unified diff
type DiffHunk ¶ added in v0.3.4
type DiffHunk struct {
StartLine int // Starting line index in Lines
EndLine int // Ending line index (exclusive)
}
DiffHunk represents a block/hunk in the diff
type DiffLine ¶ added in v0.3.4
type DiffLine struct {
LeftNum int // Line number on left (0 = no line)
LeftText string // Content on left side
RightNum int // Line number on right (0 = no line)
RightText string // Content on right side
Type LineType // Type of line
}
DiffLine represents a single line in a side-by-side diff
type DiffModeView ¶ added in v0.3.4
DiffModeView holds the state for the diff mode selection
type DiffView ¶ added in v0.3.4
type DiffView struct {
File *ChangedFile
Lines []DiffLine
Hunks []DiffHunk // List of hunks for block navigation
CurrentHunk int // Currently highlighted hunk index
ScrollOffset int
TermWidth int
TermHeight int
LeftWidth int
RightWidth int
ShowFullFile bool // Toggle: false = changes only (default), true = full file
FullFileLines []DiffLine // Full file side-by-side view
FullFileHunks []DiffHunk // Hunk positions in full file view
// For hunk staging/unstaging
Mode DiffMode
WorktreePath string
BaseBranch string
RawDiff string // Original unified diff text for hunk extraction
}
DiffView holds the state for the diff viewer
type FileListView ¶ added in v0.3.4
type FileListView struct {
Files []ChangedFile
Cursor int
BaseBranch string
Title string
Mode DiffMode // Track which mode we're in for stage/unstage
WorktreePath string // Path for git operations
}
FileListView holds the state for the file list
type InputConfig ¶
type InputConfig struct {
Type string `yaml:"type"` // "boolean", "option", "text"
Message string `yaml:"message"` // Prompt message (can be multiline)
Options []Option `yaml:"options,omitempty"` // For "option" type only
}
InputConfig represents user input configuration for an action
type MergeConflictResult ¶ added in v0.3.5
MergeConflictResult represents the result of a merge conflict check
type MultiSelectItem ¶
MultiSelectItem represents an item in a multi-select list
type Option ¶
type Option struct {
Option string `yaml:"option"` // Required: the key to press
Description string `yaml:"description,omitempty"` // Optional: help text
Script string `yaml:"script,omitempty"` // Optional: script for this option
Default bool `yaml:"default,omitempty"` // Optional: mark as default option
}
Option represents a selectable option with optional description and script
type UntrackedFile ¶ added in v0.3.5
UntrackedFile represents an untracked file with its content
type ViewAction ¶ added in v0.3.4
type ViewAction int
ViewAction represents what the view should do
const ( ViewActionNone ViewAction = iota ViewActionRedraw ViewActionSelect ViewActionClose ViewActionQuit ViewActionRefresh // Refresh file list after stage/unstage )
type WIPChanges ¶ added in v0.3.5
type WIPChanges struct {
WorktreePath string
Branch string
Diff string // Combined staged+unstaged diff
Untracked []UntrackedFile // Untracked files with content
HasChanges bool
}
WIPChanges represents uncommitted changes from a worktree
type WorktreeChanges ¶ added in v0.3.5
WorktreeChanges holds counts of different change types
type WorktreeInfo ¶
WorktreeInfo represents information about a git worktree
type WorktreeStatus ¶
WorktreeStatus represents the status of a worktree