Help us shape the future of Go! Take the 2026 Go Developer Survey

git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package git correlates commit history into weighted co_committed graph edges (SYN-14).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(store graph.Store, repoRoot string, opts Options) (int, error)

Analyze walks history and upserts co_committed edges between existing file nodes. Soft-skips when repoRoot is not a git repository. Writes to the member store only.

func TopCoChanges

func TopCoChanges(store graph.Store, pathOrID string, limit int) ([]graph.Edge, error)

TopCoChanges returns co_committed neighbors for a file path or file node id, sorted by weight.

Types

type CommitFiles

type CommitFiles struct {
	Hash  string
	When  time.Time
	Paths []string
}

CommitFiles is one commit's touched paths (repo-relative slash paths).

func Walk

func Walk(repoRoot string, opts Options) ([]CommitFiles, error)

Walk returns commit file sets via go-git (no git CLI).

type Options

type Options struct {
	MaxCommits int
	Since      time.Time
	MinSupport int
	// HalfLifeDays controls recency decay (weight *= 0.5^(ageDays/HalfLifeDays)).
	HalfLifeDays float64
}

Options configure history walking and co-change aggregation.

type Pair

type Pair struct {
	A, B     string
	Support  int
	Weight   float64
	LastHash string
}

Pair is an aggregated co-change between two file paths.

func Aggregate

func Aggregate(commits []CommitFiles, opts Options) []Pair

Aggregate builds pairwise co-change weights with recency decay and min-support.

Jump to

Keyboard shortcuts

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