shared

package
v10.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCheckoutOpcode

func IsCheckoutOpcode(opcode Opcode) bool

Types

type Opcode

type Opcode interface {
	// CreateAbortProgram provides the abort opcodes for this opcode.
	CreateAbortProgram() []Opcode

	// CreateContinueProgram provides the continue opcodes for this opcode.
	CreateContinueProgram() []Opcode

	// CreateAutomaticAbortError provides the error message to display when this opcode
	// cause the command to automatically abort.
	CreateAutomaticAbortError() error

	// Run executes this opcode.
	Run(args RunArgs) error

	// ShouldAutomaticallyAbortOnError indicates whether this opcode should
	// cause the command to automatically abort if it errors.
	// When true, automatically runs the abort logic and leaves the user where they started.
	// When false, stops execution to let the user fix the issue and continue or manually abort.
	ShouldAutomaticallyAbortOnError() bool
}

Opcode is an atomic operation that the Git Town interpreter can execute. Opcodes implement the command pattern (https://en.wikipedia.org/wiki/Command_pattern) and provide opcodes to continue and abort them. Undoing an opcode is done via the undo package.

type RunArgs

type RunArgs struct {
	PrependOpcodes                  func(...Opcode)
	Connector                       hosting.Connector
	Lineage                         config.Lineage
	RegisterUndoablePerennialCommit func(domain.SHA)
	Runner                          *git.ProdRunner
	UpdateInitialBranchLocalSHA     func(domain.LocalBranchName, domain.SHA) error
}

Jump to

Keyboard shortcuts

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