fossil

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(cwd string, tokens int, path string) (string, error)

Log returns a token-budgeted git log for the given path (or the whole repo if path is empty). Output is plain text suitable for agent consumption.

func RegisterInterceptor added in v0.20.3

func RegisterInterceptor(e *sdk.Extension)

RegisterInterceptor adds blame context to read tool results. When the model reads a file, a compact blame summary is appended, showing which commits last touched the code — giving the model "why was this written?" context before it edits.

Types

type BlameEntry

type BlameEntry struct {
	SHA     string `json:"sha"`
	Author  string `json:"author"`
	Date    string `json:"date"`
	Summary string `json:"summary"`
	Lines   string `json:"lines"` // e.g. "42-58" or "42"
}

BlameEntry represents a unique commit that touches a blamed line range.

func Why

func Why(cwd, file string, startLine, endLine int) ([]BlameEntry, error)

Why returns the blame history for the given file and optional line range. If startLine and endLine are both 0, the entire file is blamed.

type ChangeSummary

type ChangeSummary struct {
	SHA     string       `json:"sha"`
	Author  string       `json:"author"`
	Subject string       `json:"subject"`
	Files   []FileChange `json:"files"`
}

ChangeSummary represents a single commit with its file-level change stats.

func Changes

func Changes(cwd, since, path string) ([]ChangeSummary, error)

Changes returns commits reachable since the given duration string (e.g. "7d", "24h") optionally filtered to a path. If since is empty it defaults to "7d".

type CoChangeEntry

type CoChangeEntry struct {
	File  string `json:"file"`
	Count int    `json:"count"`
}

CoChangeEntry holds a file and the number of commits in which it co-changed with the target file.

func CoChange

func CoChange(cwd, file string, limit int) ([]CoChangeEntry, error)

CoChange returns files that frequently change together with the given file, sorted by co-occurrence count descending.

type FileChange

type FileChange struct {
	File    string `json:"file"`
	Added   int    `json:"added"`
	Deleted int    `json:"deleted"`
}

FileChange holds the per-file add/delete counts for a commit.

type OwnerEntry

type OwnerEntry struct {
	Author  string  `json:"author"`
	Commits int     `json:"commits"`
	Percent float64 `json:"percent"`
}

OwnerEntry holds commit authorship statistics for a single author.

func Owners

func Owners(cwd, path string, limit int) ([]OwnerEntry, error)

Owners returns the top commit authors for the given path (or the whole repo if path is empty), sorted by commit count descending.

Jump to

Keyboard shortcuts

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