gitdiff

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OriginMain = "origin/main"
	LocalMain  = "main"
)

Variables

View Source
var (
	ErrNotAGitRepo    = fmt.Errorf("not a git repository: ensure you are in a git repository or provide a valid file path")
	ErrNoParentBranch = fmt.Errorf("no parent branch found: are you on the main branch for this repository?")
)
View Source
var DefaultOptions = Options{}

Functions

This section is empty.

Types

type Options

type Options struct {
	TargetRef string // Target ref for git diff, e.g., "origin/main" or commit hash.
}

type Results

type Results struct {
	RootDir  string
	NewLines map[string]map[int]bool
}

func NewResults

func NewResults() (*Results, error)

func Run

func Run(debug bool, opts *Options) (*Results, error)

Run executes the 'git diff' command with the provided options and parses its output into a Results struct. If opts is nil, it uses DefaultOptions.

func (*Results) Files

func (d *Results) Files() []string

Files returns a sorted list of unique file paths that have new lines in the git diff.

Jump to

Keyboard shortcuts

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