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

git

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateOptions

func ValidateOptions(options ChangeOptions) error

ValidateOptions validates affected-like option combinations.

Types

type ChangeDetector

type ChangeDetector struct {
	// contains filtered or unexported fields
}

ChangeDetector detects files that have changed in git

func NewChangeDetector

func NewChangeDetector(baseBranch string) *ChangeDetector

NewChangeDetector creates a new change detector

func NewChangeDetectorWithOptions

func NewChangeDetectorWithOptions(options ChangeOptions) *ChangeDetector

NewChangeDetectorWithOptions creates a new change detector with explicit options.

func (*ChangeDetector) GetChangedFiles

func (cd *ChangeDetector) GetChangedFiles() ([]string, error)

GetChangedFiles returns files based on Nx-style affected resolution.

func (*ChangeDetector) GetChangedFilesUnderPath

func (cd *ChangeDetector) GetChangedFilesUnderPath(path string) ([]string, error)

GetChangedFilesUnderPath returns files that have changed under a specific path

func (*ChangeDetector) IsAnyPathChanged

func (cd *ChangeDetector) IsAnyPathChanged(paths []string) (bool, error)

IsAnyPathChanged checks if any files under any of the given paths have changed

func (*ChangeDetector) IsIntentFileChanged

func (cd *ChangeDetector) IsIntentFileChanged(intentFile string) (bool, error)

IsIntentFileChanged checks if the intent file itself has changed

func (*ChangeDetector) IsPathChanged

func (cd *ChangeDetector) IsPathChanged(path string) (bool, error)

IsPathChanged checks if any files under a given path have changed

type ChangeOptions

type ChangeOptions struct {
	Base        string
	Head        string
	Files       []string
	Uncommitted bool
	Untracked   bool
}

ChangeOptions defines Nx-style criteria for selecting changed files. Priority follows Nx semantics: 1) files 2) uncommitted 3) untracked 4) base + head 5) base only (committed + uncommitted + untracked) 6) default base (main) + current workspace changes

Jump to

Keyboard shortcuts

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