context

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package context provides git and code context enrichment for diffs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blame

func Blame(file string, startLine, endLine int) (string, error)

Blame runs git blame on a specific line range and returns a summary.

func ChangedFiles

func ChangedFiles(base string) ([]string, error)

ChangedFiles returns the list of files changed relative to a base.

func DiffBase

func DiffBase(base string) (string, error)

DiffBase returns the diff of the current branch against a base branch.

func FormatContext

func FormatContext(contexts []FileContext) string

FormatContext renders file contexts as text suitable for LLM prompt injection.

Types

type FileContext

type FileContext struct {
	Path          string
	RecentCommits []string
	BlameSnippet  string
}

FileContext holds contextual information about a changed file.

func Enrich

func Enrich(files []string) []FileContext

Enrich gathers git context for the given file paths. Returns context for each file, best-effort (non-fatal on failures).

Jump to

Keyboard shortcuts

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