Help us shape the future of Go! Take the 2026 Go Developer Survey

abort

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package abort implements the stackit abort command for canceling in-progress operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx *app.Context, opts Options, handler Handler) error

Action cancels an in-progress operation

func ContinuationOwnsAbort added in v0.28.0

func ContinuationOwnsAbort(ctx *app.Context, continuation *config.ContinuationState) bool

ContinuationOwnsAbort reports whether abort should unwind this continuation, rather than treat it as stale or leave abort to another interrupted operation such as a failed absorb.

A live rebase or merge always belongs to it. Once Git's operation is gone, the continuation still belongs to abort if an earlier abort began the rollback, or if the rebased branch still sits at its pre-rebase tip: the user unwound Git by hand (`git rebase --abort`) and the rollback is still owed. A branch that has moved on means the conflict was finished outside stackit (`git rebase --continue`); its snapshot predates whatever the user has done since, and restoring it would roll that work back.

Types

type Handler

type Handler interface {
	// PromptConfirmAbort prompts user to confirm aborting the current operation
	// Returns true to proceed with abort, false to cancel
	PromptConfirmAbort() (bool, error)

	// Cleanup restores terminal state (may be no-op)
	Cleanup()

	// IsInteractive returns true if the handler supports interactive prompts
	IsInteractive() bool
}

Handler receives events from abort action

type NullHandler

type NullHandler struct {
	handler.NullBase
}

NullHandler is a no-op handler for when nil is passed

func (*NullHandler) PromptConfirmAbort

func (h *NullHandler) PromptConfirmAbort() (bool, error)

PromptConfirmAbort implements Handler. Returns false (cancel) for null handler.

type Options

type Options struct {
	Force bool
}

Options contains options for the abort command

Jump to

Keyboard shortcuts

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