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

cmd

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: BlueOak-1.0.0 Imports: 20 Imported by: 0

Documentation

Overview

cmd/abort.go

cmd/adopt.go

cmd/continue.go

cmd/create.go

cmd/init.go

cmd/link.go

cmd/log.go

cmd/orphan.go

cmd/restack.go

cmd/root.go

cmd/shortcuts.go

cmd/submit.go

cmd/sync.go

cmd/undo.go

cmd/unlink.go

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = errors.New("rebase conflict: resolve and run 'gh stack continue', or 'gh stack abort'")

ErrConflict indicates a rebase conflict occurred during restack.

Functions

func Execute

func Execute() error

Execute runs the root command.

Types

type RestackOptions added in v0.6.3

type RestackOptions struct {
	// DryRun prints what would be done without actually rebasing.
	DryRun bool
	// Operation is the type of operation being performed (state.OperationRestack
	// or state.OperationSubmit).
	Operation string
	// UpdateOnly skips creating new PRs; only existing PRs are updated.
	// Submit-only.
	UpdateOnly bool
	// OpenWeb opens PRs in the browser after creation/update. Submit-only.
	OpenWeb bool
	// PushOnly skips the PR creation/update phase entirely. Submit-only.
	PushOnly bool
	// Branches is the complete list of branch names being submitted, used
	// to rebuild the full set for push/PR phases after restack completes.
	// Submit-only. Mirrors state.RestackState.Branches.
	Branches []string
	// StashRef is the commit hash of auto-stashed changes (if any), persisted
	// to state so they can be restored when the operation completes or is aborted.
	StashRef string
	// Worktrees maps branch names to linked worktree paths. When non-nil, branches
	// present in the map are rebased directly in their worktree directory instead
	// of being checked out in the main working tree.
	Worktrees map[string]string
	// NoUpdateRefs suppresses --update-refs on rebase invocations when true.
	// --update-refs is also suppressed automatically when Worktrees is non-empty
	// because git silently skips refs checked out in other worktrees, which
	// would corrupt the stack without any error or warning.
	NoUpdateRefs bool
}

RestackOptions configures the behaviour of doRestackWithState.

The submit-specific fields (UpdateOnly, OpenWeb, PushOnly, Branches) are only meaningful when Operation is state.OperationSubmit; they are persisted to restack state so that the push/PR phases can be resumed after a conflict.

type SubmitOptions added in v0.6.3

type SubmitOptions struct {
	// DryRun prints what would be done without actually pushing or creating PRs.
	DryRun bool
	// UpdateOnly skips creating new PRs; only existing PRs are updated.
	UpdateOnly bool
	// OpenWeb opens newly created PRs in the browser.
	OpenWeb bool
	// PushOnly skips the PR creation/update phase entirely.
	PushOnly bool
}

SubmitOptions configures the push and PR phases of submit.

Jump to

Keyboard shortcuts

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