Documentation
¶
Index ¶
- func FileExists(path string) (bool, error)
- func GetCommitDartFiles(repoPath, commitID string) ([]string, error)
- func GetCommitFileStats(repoPath, commitID string) (map[string]vcs.FileStats, error)
- func GetCommitRangeFileStats(repoPath, fromCommit, toCommit string) (map[string]vcs.FileStats, error)
- func GetCommitRangeFiles(repoPath, fromCommit, toCommit string) ([]string, error)
- func GetCommitRangeLabel(repoPath, fromCommit, toCommit string) (string, error)
- func GetCommitTreeFiles(repoPath, commitID string) ([]string, error)
- func GetCurrentCommitHash(repoPath string) (string, error)
- func GetFileContentFromCommit(repoPath, commitID, filePath string) ([]byte, error)
- func GetRepositoryRoot(repoPath string) (string, error)
- func GetRepositoryStateSignature(repoPath string) (string, error)
- func GetShortCommitHash(repoPath, commitID string) (string, error)
- func GetUncommittedFileStats(repoPath string) (map[string]vcs.FileStats, error)
- func GetUncommittedFiles(repoPath string) ([]string, error)
- func GitCommitContentReader(repoPath, commitID string) vcs.ContentReader
- func HasUncommittedChanges(repoPath string) (bool, error)
- func ListTrackedFiles(repoPath string) ([]string, error)
- func ListUntrackedFiles(repoPath string) ([]string, error)
- func NormalizeCommitRange(repoPath, from, to string) (string, string, bool, error)
- func ParseCommitRange(commitSpec string) (string, string, bool)
- func ResolveFirstParent(repoPath, commitID string) (parent string, hasParent bool, err error)
- func ValidateCommit(repoPath, commitID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶ added in v0.14.0
FileExists checks whether a file exists on disk.
func GetCommitDartFiles ¶
GetCommitDartFiles finds all files that were changed in a specific commit. Returns absolute paths to all files added, modified, or renamed in the commit.
func GetCommitFileStats ¶
GetCommitFileStats returns statistics (additions/deletions) for files in a specific commit Returns a map from absolute file paths to their FileStats
func GetCommitRangeFileStats ¶
func GetCommitRangeFileStats(repoPath, fromCommit, toCommit string) (map[string]vcs.FileStats, error)
GetCommitRangeFileStats returns statistics (additions/deletions) for files changed between two commits. Returns a map from absolute file paths to their FileStats.
func GetCommitRangeFiles ¶
GetCommitRangeFiles finds all files changed between two commits. Uses: git diff --name-only --diff-filter=d <from> <to> Returns absolute paths to all files added, modified, or renamed between the commits.
func GetCommitRangeLabel ¶
GetCommitRangeLabel returns a label like "abc123...def456" for display
func GetCommitTreeFiles ¶
GetCommitTreeFiles returns all files that exist in a commit's tree. Unlike GetCommitDartFiles which only returns files changed in a commit, this returns all files that existed at that point in time. Returns absolute paths to all files in the commit tree.
func GetCurrentCommitHash ¶
GetCurrentCommitHash returns the current commit hash (HEAD)
func GetFileContentFromCommit ¶
GetFileContentFromCommit reads the content of a file at a specific commit using 'git show commit:path'. The filePath should be relative to the repository root.
func GetRepositoryRoot ¶
GetRepositoryRoot returns the absolute path to the repository root
func GetRepositoryStateSignature ¶ added in v0.15.0
GetRepositoryStateSignature returns a compact signature of repository state. It includes HEAD and porcelain status so callers can detect commit/index/worktree transitions.
func GetShortCommitHash ¶
GetShortCommitHash returns the short version of a given commit hash
func GetUncommittedFileStats ¶
GetUncommittedFileStats returns statistics (additions/deletions) for uncommitted files Returns a map from relative file paths to their FileStats
func GetUncommittedFiles ¶
GetUncommittedFiles finds all uncommitted files in a git repository. Returns absolute paths to all uncommitted files (staged, unstaged, and untracked).
func GitCommitContentReader ¶
func GitCommitContentReader(repoPath, commitID string) vcs.ContentReader
GitCommitContentReader returns a ContentReader that reads file content from a specific git commit.
func HasUncommittedChanges ¶
HasUncommittedChanges checks if there are any uncommitted changes in the repository
func ListTrackedFiles ¶ added in v0.14.0
ListTrackedFiles returns absolute paths for files tracked in the git index.
func ListUntrackedFiles ¶ added in v0.14.0
ListUntrackedFiles returns absolute paths for non-ignored untracked files.
func NormalizeCommitRange ¶
NormalizeCommitRange ensures commits are in chronological order (older first). If the commits are reversed (newer...older), it swaps them. Returns (olderCommit, newerCommit, swapped, error)
func ParseCommitRange ¶
ParseCommitRange parses a commit specification and returns the from/to commits. Supports formats: "abc...def", "abc..def", or single commit "abc" Returns (from, to, isRange)
func ResolveFirstParent ¶ added in v0.14.0
ResolveFirstParent resolves the first parent of a commit. Returns hasParent=false for root commits.
func ValidateCommit ¶ added in v0.14.0
ValidateCommit validates that a commit reference resolves in the given repository.
Types ¶
This section is empty.