git

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package git reads commit history from a local repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangedFiles

func ChangedFiles(ctx context.Context, repoPath, sha string) ([]string, error)

ChangedFiles returns the paths changed by sha, relative to the repo root. --root makes this correct for a commit with no parent (diffed against an empty tree) as well as any ordinary commit.

func Tags

func Tags(ctx context.Context, repoPath string) ([]string, error)

Tags returns every tag reachable from HEAD in repoPath. A repository with no commits yet returns an empty slice, not an error.

Types

type Commit

type Commit struct {
	SHA        string
	AuthorName string
	Message    string
}

Commit is a single commit as read from git log, oldest fields only — callers parse Message themselves (see internal/commit).

func Log

func Log(ctx context.Context, repoPath, since string) ([]Commit, error)

Log returns every commit reachable from HEAD in repoPath, most recent first. If since is non-empty, only commits after that ref are returned (since..HEAD) — used to bound history to "since the last release". A repository with no commits yet returns an empty slice, not an error.

Jump to

Keyboard shortcuts

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