git

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatChangeSummary

func FormatChangeSummary(changes []FileChange, repoPath string) string

FormatChangeSummary returns a formatted summary of changes for display

func IsGitRepository

func IsGitRepository(projectPath string) bool

IsGitRepository checks if the given path is a git repository

Types

type ChangeType

type ChangeType string

ChangeType represents the type of change in a file

const (
	ChangeTypeAdded    ChangeType = "added"
	ChangeTypeModified ChangeType = "modified"
	ChangeTypeDeleted  ChangeType = "deleted"
)

type ChangesAnalyzer

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

ChangesAnalyzer analyzes git changes in a repository

func NewChangesAnalyzer

func NewChangesAnalyzer(projectPath string) (*ChangesAnalyzer, error)

NewChangesAnalyzer creates a new git changes analyzer

func (*ChangesAnalyzer) GetAllChangedFiles

func (ca *ChangesAnalyzer) GetAllChangedFiles(includeRecentCommits bool, numCommits int) ([]FileChange, error)

GetAllChangedFiles returns all changed files including unstaged, staged, and recent commits

func (*ChangesAnalyzer) GetBranchName

func (ca *ChangesAnalyzer) GetBranchName() (string, error)

GetBranchName returns the current branch name

func (*ChangesAnalyzer) GetChangedFiles

func (ca *ChangesAnalyzer) GetChangedFiles() ([]FileChange, error)

GetChangedFiles returns all files that have been modified, added, or staged

func (*ChangesAnalyzer) GetCommitHash

func (ca *ChangesAnalyzer) GetCommitHash() (string, error)

GetCommitHash returns the hash of the current commit

func (*ChangesAnalyzer) GetLastCommitMessage

func (ca *ChangesAnalyzer) GetLastCommitMessage() (string, error)

GetLastCommitMessage returns the message of the last commit

func (*ChangesAnalyzer) GetRecentCommitsFiles

func (ca *ChangesAnalyzer) GetRecentCommitsFiles(numCommits int) ([]FileChange, error)

GetRecentCommitsFiles returns files changed in the last N commits

func (*ChangesAnalyzer) HasChanges

func (ca *ChangesAnalyzer) HasChanges() (bool, error)

HasChanges returns true if there are any staged or unstaged changes

type FileChange

type FileChange struct {
	Path       string
	ChangeType ChangeType
	IsStaged   bool
}

FileChange represents a file that has been changed

Jump to

Keyboard shortcuts

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