daemon

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 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
	DaemonKindMoveTodoUp
	DaemonKindMoveTodoDown
	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 NewMoveTodoDownInstruction added in v0.38.0

func NewMoveTodoDownInstruction(sha string) Instruction

func NewMoveTodoUpInstruction added in v0.38.0

func NewMoveTodoUpInstruction(sha 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 MoveTodoDownInstruction added in v0.38.0

type MoveTodoDownInstruction struct {
	Sha string
}

func (*MoveTodoDownInstruction) Kind added in v0.38.0

func (self *MoveTodoDownInstruction) Kind() DaemonKind

func (*MoveTodoDownInstruction) SerializedInstructions added in v0.38.0

func (self *MoveTodoDownInstruction) SerializedInstructions() string

type MoveTodoUpInstruction added in v0.38.0

type MoveTodoUpInstruction struct {
	Sha string
}

func (*MoveTodoUpInstruction) Kind added in v0.38.0

func (self *MoveTodoUpInstruction) Kind() DaemonKind

func (*MoveTodoUpInstruction) SerializedInstructions added in v0.38.0

func (self *MoveTodoUpInstruction) 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