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

squash

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package squash implements the squash command, which squashes a branch's commits into one and restacks its upstack branches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, deps Deps, opts Options) error

Action performs the squash operation

Types

type Deps

type Deps struct {
	Engine Engine
	actions.MutationDeps
	Log output.Logger
	// Verify runs git commit hooks when set (the inverse of --no-verify).
	Verify bool
}

Deps are the collaborators squash needs. Adapters build them from their own runtime state; the action never sees bootstrap types.

type Engine

type Engine interface {
	actions.OwnershipEngine
	CurrentBranch(ctx context.Context) *engine.Branch
	CheckoutBranch(ctx context.Context, branch engine.Branch) error
	SquashCurrentBranch(ctx context.Context, opts engine.SquashOptions) error
	Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
}

Engine lists exactly the engine methods squash calls.

type Options

type Options struct {
	// Branch is the branch to squash. Empty means the current branch. When it
	// names another branch, the action checks it out for the squash and
	// restores the original branch afterwards, on success or failure.
	Branch  string
	Message string
	NoEdit  bool
}

Options contains options for the squash command

Jump to

Keyboard shortcuts

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