daemon

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 14 Imported by: 1

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 added in v0.38.0

func ToEnvVars(instruction Instruction) []string

func TodoLinesToString added in v0.38.0

func TodoLinesToString(todoLines []TodoLine) string

Types

type ChangeTodoAction added in v0.38.0

type ChangeTodoAction struct {
	Sha       string
	NewAction todo.TodoCommand
}

type ChangeTodoActionsInstruction added in v0.38.0

type ChangeTodoActionsInstruction struct {
	Changes []ChangeTodoAction
}

func (*ChangeTodoActionsInstruction) Kind added in v0.38.0

func (*ChangeTodoActionsInstruction) SerializedInstructions added in v0.38.0

func (self *ChangeTodoActionsInstruction) SerializedInstructions() string

type CherryPickCommitsInstruction added in v0.38.0

type CherryPickCommitsInstruction struct {
	Todo string
}

func (*CherryPickCommitsInstruction) Kind added in v0.38.0

func (*CherryPickCommitsInstruction) SerializedInstructions added in v0.38.0

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 added in v0.38.0

type ExitImmediatelyInstruction struct{}

func (*ExitImmediatelyInstruction) Kind added in v0.38.0

func (*ExitImmediatelyInstruction) SerializedInstructions added in v0.38.0

func (self *ExitImmediatelyInstruction) SerializedInstructions() string

type InsertBreakInstruction added in v0.38.0

type InsertBreakInstruction struct{}

func (*InsertBreakInstruction) Kind added in v0.38.0

func (self *InsertBreakInstruction) Kind() DaemonKind

func (*InsertBreakInstruction) SerializedInstructions added in v0.38.0

func (self *InsertBreakInstruction) SerializedInstructions() string

type Instruction added in v0.38.0

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 added in v0.38.0

func NewChangeTodoActionsInstruction(changes []ChangeTodoAction) Instruction

func NewCherryPickCommitsInstruction added in v0.38.0

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

func NewExitImmediatelyInstruction added in v0.38.0

func NewExitImmediatelyInstruction() Instruction

func NewInsertBreakInstruction added in v0.38.0

func NewInsertBreakInstruction() Instruction

func NewMoveFixupCommitDownInstruction added in v0.38.0

func NewMoveFixupCommitDownInstruction(originalSha string, fixupSha string) Instruction

func NewMoveTodosDownInstruction added in v0.41.0

func NewMoveTodosDownInstruction(shas []string) Instruction

func NewMoveTodosUpInstruction added in v0.41.0

func NewMoveTodosUpInstruction(shas []string) Instruction

type MoveFixupCommitDownInstruction added in v0.38.0

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 added in v0.38.0

func (*MoveFixupCommitDownInstruction) SerializedInstructions added in v0.38.0

func (self *MoveFixupCommitDownInstruction) SerializedInstructions() string

type MoveTodosDownInstruction added in v0.41.0

type MoveTodosDownInstruction struct {
	Shas []string
}

func (*MoveTodosDownInstruction) Kind added in v0.41.0

func (self *MoveTodosDownInstruction) Kind() DaemonKind

func (*MoveTodosDownInstruction) SerializedInstructions added in v0.41.0

func (self *MoveTodosDownInstruction) SerializedInstructions() string

type MoveTodosUpInstruction added in v0.41.0

type MoveTodosUpInstruction struct {
	Shas []string
}

func (*MoveTodosUpInstruction) Kind added in v0.41.0

func (self *MoveTodosUpInstruction) Kind() DaemonKind

func (*MoveTodosUpInstruction) SerializedInstructions added in v0.41.0

func (self *MoveTodosUpInstruction) SerializedInstructions() string

type TodoLine added in v0.38.0

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

func (*TodoLine) ToString added in v0.38.0

func (self *TodoLine) ToString() string

Jump to

Keyboard shortcuts

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