Documentation
¶
Overview ¶
Package modify implements the modify command, which amends (or adds) a commit on the current branch or a downstack ancestor and restacks its descendants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Engine Engine
actions.MutationDeps
// RepoRoot locates the continuation state a restack conflict writes.
RepoRoot string
// Verify runs commit hooks; false passes --no-verify.
Verify bool
}
Deps are the collaborators modify needs. Adapters build them from their own runtime state; the action never sees bootstrap types.
type Engine ¶
type Engine interface {
validation.GitOperationEngine
actions.OwnershipEngine
Trunk() engine.Branch
Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
ListWorktrees(ctx context.Context) (git.WorktreeList, error)
CheckoutBranch(ctx context.Context, branch engine.Branch) error
IsBranchEmpty(ctx context.Context, branchName string) (bool, error)
StageChanges(ctx context.Context, opts git.StagingOptions) error
Commit(ctx context.Context, opts git.CommitOptions) error
InteractiveRebase(ctx context.Context, onto string) error
}
Engine lists exactly the engine methods modify calls: the branch validators, the ownership guard, and the checkout/stage/commit mutations.
type Options ¶
type Options struct {
// Staging options
All bool // Stage all changes before committing (-a)
Update bool // Stage updates to tracked files only (-u)
Patch bool // Pick hunks to stage interactively (-p)
// Commit options
CreateCommit bool // Create a new commit instead of amending (-c)
Message string // Commit message (-m)
Edit bool // Open editor to edit commit message (-e)
NoEdit bool // Don't edit commit message (computed from flags)
ResetAuthor bool // Reset author to current user
Verbose int // Show diff in commit message template (-v)
// Interactive rebase
InteractiveRebase bool // Start interactive rebase on branch commits
// Into targets a downstack ancestor of the current branch instead of the
// current branch itself. Empty means "modify the current branch".
Into string
}
Options contains options for the modify command
Click to show internal directories.
Click to hide internal directories.