rebase

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package rebase resolves merge conflicts by rebasing a PR branch onto main.

When Bellows detects a merge conflict, Rebase runs git fetch + rebase. If the rebase has conflicts that cannot be auto-resolved by git, it invokes a Smith (Claude/Gemini) worker to resolve them, then continues the rebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	// WorktreePath is the git worktree for this PR branch.
	WorktreePath string
	// Branch is the PR branch name.
	Branch string
	// BaseBranch is the branch to rebase onto (default: "main").
	BaseBranch string
	// BeadID for logging.
	BeadID string
	// AnvilName for logging.
	AnvilName string
	// PRNumber for logging.
	PRNumber int
	// DB for event logging (may be nil).
	DB *state.DB
	// WorkerID is the state DB worker ID, used to update the log path
	// so the Hearth TUI can display live activity.
	WorkerID string
	// ExtraFlags for the AI CLI.
	ExtraFlags []string
	// Providers is the ordered list of AI providers to try.
	// If empty, provider.Defaults() is used.
	Providers []provider.Provider
}

Params holds the inputs for a rebase attempt.

type Result

type Result struct {
	Success bool
	Output  string
	Error   error
}

Result holds the outcome of a rebase attempt.

func Rebase

func Rebase(ctx context.Context, p Params) Result

Rebase fetches origin and rebases the branch onto BaseBranch, then force-pushes. If git cannot auto-resolve conflicts it invokes Smith (Claude/Gemini) to fix them.

Jump to

Keyboard shortcuts

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