Documentation
¶
Index ¶
- func FormatChangeSummary(changes []FileChange, repoPath string) string
- func IsGitRepository(projectPath string) bool
- type ChangeType
- type ChangesAnalyzer
- func (ca *ChangesAnalyzer) GetAllChangedFiles(includeRecentCommits bool, numCommits int) ([]FileChange, error)
- func (ca *ChangesAnalyzer) GetBranchName() (string, error)
- func (ca *ChangesAnalyzer) GetChangedFiles() ([]FileChange, error)
- func (ca *ChangesAnalyzer) GetCommitHash() (string, error)
- func (ca *ChangesAnalyzer) GetLastCommitMessage() (string, error)
- func (ca *ChangesAnalyzer) GetRecentCommitsFiles(numCommits int) ([]FileChange, error)
- func (ca *ChangesAnalyzer) HasChanges() (bool, error)
- type FileChange
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 ¶
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