commitgraph

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Ref struct {
	Name    string
	Kind    RefKind
	Current bool
}

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 RefKind

type RefKind uint8

RefKind is what a ref names.

const (
	// RefBranch is a local branch.
	RefBranch RefKind = iota
	// RefRemote is a remote's branch.
	RefRemote
	// RefTag is a tag.
	RefTag
	// RefHead is the checkout: its branch, or HEAD detached.
	RefHead
)

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 show only the author's avatar after the subject, leaving out the author's name, hash and date. Give it a height, or let it fill what the app sizes.

func (View) Render

func (v View) Render(cx *core.Scope) core.Node

Render implements core.Node.

Jump to

Keyboard shortcuts

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