gitexec

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGitCommandTimeout = 30 * time.Second
	MaxGitOutputSize         = 100 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecGitClient

type ExecGitClient struct{}

ExecGitClient shells out to git for change detection. @intent provide GitClient behavior using the local git executable

func NewExecGitClient

func NewExecGitClient() *ExecGitClient

NewExecGitClient creates an exec-backed git client. @intent construct a GitClient that reads diffs from the local repository

func (*ExecGitClient) ChangedFiles

func (g *ExecGitClient) ChangedFiles(ctx context.Context, repoDir, baseRef string) ([]string, error)

ChangedFiles lists files changed from the given base ref. @intent identify which repository paths changed since a base revision @param repoDir repository root where git commands are executed @param baseRef git revision used as the diff baseline @return changed file paths reported by git diff --name-only @sideEffect executes git diff in the target repository @requires repoDir points to a valid git working tree @ensures returned file paths are trimmed and exclude blank lines

func (*ExecGitClient) DiffHunks

func (g *ExecGitClient) DiffHunks(ctx context.Context, repoDir, baseRef string, paths []string) ([]changesapp.Hunk, error)

DiffHunks extracts changed line ranges for the given paths. @intent map git diff output into file-level hunk ranges for overlap analysis @param repoDir repository root where git commands are executed @param baseRef git revision used as the diff baseline @param paths repository-relative paths to limit hunk extraction @return unified diff hunks with inclusive line ranges in new files @sideEffect executes git diff with zero-context output @requires repoDir points to a valid git working tree @ensures each returned hunk has a file path and inclusive start/end lines

Jump to

Keyboard shortcuts

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