Documentation
¶
Overview ¶
Package stacklog gathers the current stack's commit band for the stack-aware `stackit log` view: the commits on the branch you're standing on and its ancestors down to (but not including) trunk, ordered top-down from HEAD. It also surfaces the branch/tag decorations and trunk-tip marker the renderer needs to draw a git-log-style view with a clear trunk boundary. The result is presentation-agnostic so CLI/JSON adapters can render it however they need.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
Branch is one branch in the current stack's ancestor path, with its own commits ordered newest-first (the branch tip first).
type Commit ¶
Commit is one commit on a stack branch, identified by its full SHA so the renderer can join it against the decoration map.
type Result ¶
type Result struct {
Branches []Branch
TrunkName string
TrunkTipSHA string // full SHA of the trunk tip, for the boundary marker
Decorations map[string][]git.RefDecoration
}
Result is the gathered stack band.
Branches are ordered top-down: the branch you're standing on first, its trunk-most ancestor last; trunk itself is excluded (it's the boundary). When HEAD is on trunk or detached, Branches is empty, so callers render trunk history alone.
Decorations is keyed by full commit SHA and covers every local branch head and tag, so the renderer can annotate both the stack band and the trunk band from one map.
type Source ¶
type Source interface {
CurrentBranch() *engine.Branch
Trunk() engine.Branch
Graph(strategy engine.SortStrategy) *engine.StackGraph
BatchCommits(branches engine.Branches, format engine.CommitFormat) map[string][]string
RefDecorations() (map[string][]git.RefDecoration, error)
GetRevisionForName(branchName string) (string, error)
}
Source is the narrow engine dependency this action needs. engine.Engine satisfies it.