daemon

package
v0.0.0-...-00ab8b8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DaemonKindEnvKey string = "LAZYGIT_DAEMON_KIND"

	// Contains json-encoded arguments to the daemon
	DaemonInstructionEnvKey string = "LAZYGIT_DAEMON_INSTRUCTION"
)

Variables

This section is empty.

Functions

func Handle

func Handle(common *common.Common)

func InDaemonMode

func InDaemonMode() bool

func ToEnvVars

func ToEnvVars(instruction Instruction) []string

func TodoLinesToString

func TodoLinesToString(todoLines []TodoLine) string

Types

type ChangeTodoAction

type ChangeTodoAction struct {
	Sha       string
	NewAction todo.TodoCommand
}

type ChangeTodoActionsInstruction

type ChangeTodoActionsInstruction struct {
	Changes []ChangeTodoAction
}

func (*ChangeTodoActionsInstruction) Kind

func (*ChangeTodoActionsInstruction) SerializedInstructions

func (self *ChangeTodoActionsInstruction) SerializedInstructions() string

type CherryPickCommitsInstruction

type CherryPickCommitsInstruction struct {
	Todo string
}

func (*CherryPickCommitsInstruction) Kind

func (*CherryPickCommitsInstruction) SerializedInstructions

func (self *CherryPickCommitsInstruction) SerializedInstructions() string

type DaemonKind

type DaemonKind int
const (
	// for when we fail to parse the daemon kind
	DaemonKindUnknown DaemonKind = iota

	DaemonKindExitImmediately
	DaemonKindCherryPick
	DaemonKindMoveTodosUp
	DaemonKindMoveTodosDown
	DaemonKindInsertBreak
	DaemonKindChangeTodoActions
	DaemonKindMoveFixupCommitDown
)

type ExitImmediatelyInstruction

type ExitImmediatelyInstruction struct{}

func (*ExitImmediatelyInstruction) Kind

func (*ExitImmediatelyInstruction) SerializedInstructions

func (self *ExitImmediatelyInstruction) SerializedInstructions() string

type InsertBreakInstruction

type InsertBreakInstruction struct{}

func (*InsertBreakInstruction) Kind

func (self *InsertBreakInstruction) Kind() DaemonKind

func (*InsertBreakInstruction) SerializedInstructions

func (self *InsertBreakInstruction) SerializedInstructions() string

type Instruction

type Instruction interface {
	Kind() DaemonKind
	SerializedInstructions() string
	// contains filtered or unexported methods
}

An Instruction is a command to be run by lazygit in daemon mode. It is serialized to json and passed to lazygit via environment variables

func NewChangeTodoActionsInstruction

func NewChangeTodoActionsInstruction(changes []ChangeTodoAction) Instruction

func NewCherryPickCommitsInstruction

func NewCherryPickCommitsInstruction(commits []*models.Commit) Instruction

func NewExitImmediatelyInstruction

func NewExitImmediatelyInstruction() Instruction

func NewInsertBreakInstruction

func NewInsertBreakInstruction() Instruction

func NewMoveFixupCommitDownInstruction

func NewMoveFixupCommitDownInstruction(originalSha string, fixupSha string) Instruction

func NewMoveTodosDownInstruction

func NewMoveTodosDownInstruction(shas []string) Instruction

func NewMoveTodosUpInstruction

func NewMoveTodosUpInstruction(shas []string) Instruction

type MoveFixupCommitDownInstruction

type MoveFixupCommitDownInstruction struct {
	OriginalSha string
	FixupSha    string
}

Takes the sha of some commit, and the sha of a fixup commit that was created at the end of the branch, then moves the fixup commit down to right after the original commit, changing its type to "fixup"

func (*MoveFixupCommitDownInstruction) Kind

func (*MoveFixupCommitDownInstruction) SerializedInstructions

func (self *MoveFixupCommitDownInstruction) SerializedInstructions() string

type MoveTodosDownInstruction

type MoveTodosDownInstruction struct {
	Shas []string
}

func (*MoveTodosDownInstruction) Kind

func (self *MoveTodosDownInstruction) Kind() DaemonKind

func (*MoveTodosDownInstruction) SerializedInstructions

func (self *MoveTodosDownInstruction) SerializedInstructions() string

type MoveTodosUpInstruction

type MoveTodosUpInstruction struct {
	Shas []string
}

func (*MoveTodosUpInstruction) Kind

func (self *MoveTodosUpInstruction) Kind() DaemonKind

func (*MoveTodosUpInstruction) SerializedInstructions

func (self *MoveTodosUpInstruction) SerializedInstructions() string

type TodoLine

type TodoLine struct {
	Action string
	Commit *models.Commit
}

func (*TodoLine) ToString

func (self *TodoLine) ToString() string

Jump to

Keyboard shortcuts

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