Documentation
¶
Index ¶
- Constants
- func GetFileStatus(status StatusCode) string
- type Repository
- func (r *Repository) CommitObject(hash plumbing.Hash) (*object.Commit, error)
- func (r *Repository) CreateTag(ctx context.Context, tagName, message string) error
- func (r *Repository) FindLastVersionTag() (string, error)
- func (r *Repository) GetAllCommitMessages() ([]string, error)
- func (r *Repository) GetChangeHistory(tag string) (string, error)
- func (r *Repository) GetChangesBetween(from, to plumbing.Hash) ([]string, error)
- func (r *Repository) GetChangesSinceTag(tag string) ([]string, error)
- func (r *Repository) GetCommitMessagesSince(hash plumbing.Hash) ([]string, error)
- func (r *Repository) GetCurrentBranch() (string, error)
- func (r *Repository) GetFileDiff(path string) (string, error)
- func (r *Repository) GetFilesToCommit() ([]string, error)
- func (r *Repository) GetUserConfig() (string, string, error)
- func (r *Repository) Head() (*plumbing.Reference, error)
- func (r *Repository) MakeCommit(ctx context.Context, message string, filesToAdd []string) error
- func (r *Repository) References() (storer.ReferenceIter, error)
- func (r *Repository) ShouldIgnoreFile(path string, ignorePatterns []string, includeGitignore bool) bool
- func (r *Repository) StageFiles(files []string) error
- func (r *Repository) Status() (gogit.Status, error)
- type StatusCode
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func GetFileStatus ¶
func GetFileStatus(status StatusCode) string
GetFileStatus returns a string representation of a git status code
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func OpenRepository ¶
func OpenRepository(path string, cfg config.GitConfig) (*Repository, error)
func (*Repository) CommitObject ¶
func (*Repository) CreateTag ¶
func (r *Repository) CreateTag(ctx context.Context, tagName, message string) error
CreateTag creates a new tag at HEAD with the given name and message
func (*Repository) FindLastVersionTag ¶
func (r *Repository) FindLastVersionTag() (string, error)
FindLastVersionTag locates the most recent semantic version tag
func (*Repository) GetAllCommitMessages ¶
func (r *Repository) GetAllCommitMessages() ([]string, error)
GetAllCommitMessages returns all commit messages in the repository
func (*Repository) GetChangeHistory ¶
func (r *Repository) GetChangeHistory(tag string) (string, error)
GetChangeHistory retrieves commit messages since a specific tag or all commits
func (*Repository) GetChangesBetween ¶
func (r *Repository) GetChangesBetween(from, to plumbing.Hash) ([]string, error)
GetChangesBetween returns commit messages between two commits
func (*Repository) GetChangesSinceTag ¶
func (r *Repository) GetChangesSinceTag(tag string) ([]string, error)
GetChangesSinceTag returns commit messages between the specified tag and HEAD
func (*Repository) GetCommitMessagesSince ¶
func (r *Repository) GetCommitMessagesSince(hash plumbing.Hash) ([]string, error)
GetCommitMessagesSince returns all commit messages since a given hash
func (*Repository) GetCurrentBranch ¶
func (r *Repository) GetCurrentBranch() (string, error)
func (*Repository) GetFileDiff ¶
func (r *Repository) GetFileDiff(path string) (string, error)
func (*Repository) GetFilesToCommit ¶
func (r *Repository) GetFilesToCommit() ([]string, error)
func (*Repository) GetUserConfig ¶
func (r *Repository) GetUserConfig() (string, string, error)
getUserConfig returns the user's name and email from git config.
func (*Repository) MakeCommit ¶
MakeCommit creates a new commit with the given message and files
func (*Repository) References ¶
func (r *Repository) References() (storer.ReferenceIter, error)
func (*Repository) ShouldIgnoreFile ¶
func (r *Repository) ShouldIgnoreFile(path string, ignorePatterns []string, includeGitignore bool) bool
func (*Repository) StageFiles ¶
func (r *Repository) StageFiles(files []string) error
StageFiles stages the given files in the repository
type StatusCode ¶
type StatusCode = gogit.StatusCode