gitlog

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package gitlog is a list of recent commits on one branch, from GitHub or a local clone, in one shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Behind

func Behind(ctx context.Context, dir, sha, ref string) (behind int, onBranch bool, err error)

Behind counts the commits on ref that sha does not have. onBranch is false when sha is not an ancestor of ref (force push, rebase, hotfix branch), and behind is then meaningless.

Types

type Commit

type Commit struct {
	SHA       string
	Message   string // first line
	Author    string
	Login     string // GitHub login, "" locally
	AvatarURL string // "" locally: the row shows initials
	URL       string // the commit on GitHub, "" locally
	When      time.Time
}

Commit is one commit as the log shows it.

func Local

func Local(ctx context.Context, dir, ref string, n int) ([]Commit, error)

Local reads the last n commits of ref from a clone at dir.

func One

func One(ctx context.Context, dir, sha string) (Commit, error)

One reads a single commit from a clone at dir.

func (Commit) Short

func (c Commit) Short() string

Short is the 7-char hash.

Jump to

Keyboard shortcuts

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