Documentation
¶
Overview ¶
Package commitgraph is base/commitgraph's styled form: a repository's commits as a virtualized list beside their revision graph, in the look of Onegit's All Commits page.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
Hash string
// Parents are the commit's parents' hashes, the first parent first.
Parents []string
// Short is the abbreviated hash, the first 7 characters of Hash when
// empty.
Short string
Subject string
// More tells that the message goes on after Subject.
More bool
// Avatar is the URL of the author's picture; without it the author's
// initials show.
Avatar string
Author string
Date time.Time
Refs []Ref
// Head marks the checked out commit, whose subject is bold.
Head bool
}
Commit is a row of a View.
type Ref ¶
Ref is a label at a commit. Current marks in bold what the checkout is on, such as its upstream; a RefHead always is.
type View ¶
type View struct {
Commits func() []Commit
// Selection holds the chosen commits' hashes.
Selection *ui.Selection
// OnActivate receives the commit Enter or a double click activates.
OnActivate func(Commit)
// OnLoadMore runs as the end of the rows comes near, for the next page.
OnLoadMore func()
// Empty shows while there are no commits.
Empty core.Node
// Label names the list for assistive technology.
Label string
Ref *core.Ref
TestID string
Style core.Style
}
View lists Commits, newest first with each after its children as `git log --date-order` lists them, beside their revision graph. A merge's node collapses or expands the commits it brings in. Rows narrower than 560 points leave out the author, hash and date. Give it a height, or let it fill what the app sizes.