Documentation
¶
Index ¶
- type AuthorInfo
- type FileVersion
- type GitOps
- type GitShellUtil
- type GitUtil
- func (g *GitUtil) Add(paths ...string) error
- func (g *GitUtil) Author(filePath string) (*AuthorInfo, error)
- func (g *GitUtil) CurrentBranch() (string, error)
- func (g *GitUtil) CurrentUser() (name string, email string, err error)
- func (g *GitUtil) FileVersionsSince(filePath string, since time.Time, includePrior bool) ([]FileVersion, error)
- func (g *GitUtil) Remove(paths ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorInfo ¶
type AuthorInfo = shell.AuthorInfo
AuthorInfo contains information about who created a file
type FileVersion ¶
type FileVersion = shell.FileVersion
FileVersion represents the content of a file at a specific commit
type GitOps ¶
type GitOps interface {
Add(paths ...string) error
Remove(paths ...string) error
CurrentUser() (name string, email string, err error)
Author(filePath string) (*AuthorInfo, error)
AllAuthors(dirPattern string) (map[string]*AuthorInfo, error)
LastCommitTime(filePath string) (time.Time, error)
AllLastCommitTimes(dirPattern string) (map[string]time.Time, error)
CurrentBranch() (string, error)
FileVersionsSince(filePath string, since time.Time, includePrior bool) ([]FileVersion, error)
AllFileVersionsSince(dirPattern string, since time.Time, includePrior bool) (map[string][]FileVersion, error)
AllUsers() ([]string, error)
}
GitOps defines the interface for git operations
type GitShellUtil ¶
GitShellUtil is an alias to shell.Util for backward compatibility
func NewGitShellUtil ¶
func NewGitShellUtil(repoPath string) (*GitShellUtil, error)
NewGitShellUtil creates a new shell-based Git utility
type GitUtil ¶
type GitUtil struct {
// contains filtered or unexported fields
}
GitUtil provides Git operations using go-git library
func NewGitUtilWithGoGit ¶
NewGitUtilWithGoGit creates a new GitUtil instance using go-git
func (*GitUtil) Author ¶
func (g *GitUtil) Author(filePath string) (*AuthorInfo, error)
Author returns information about who created a file
func (*GitUtil) CurrentBranch ¶
CurrentBranch returns the name of the currently active branch
func (*GitUtil) CurrentUser ¶
CurrentUser returns the current git user's name and email
func (*GitUtil) FileVersionsSince ¶
func (g *GitUtil) FileVersionsSince(filePath string, since time.Time, includePrior bool) ([]FileVersion, error)
FileVersionsSince returns file contents for commits since the provided time. if includePrior is true, the most recent commit before the given time is included as the first version.