Documentation
¶
Index ¶
- Variables
- func GetCommitFromTag(repo *git.Repository, tagRef *plumbing.Reference) (*object.Commit, error)
- func GetCommitMessagesSinceCommitHash(repo *git.Repository, commitHash plumbing.Hash) ([]string, error)
- func GetCommitsSinceCommitHash(repo *git.Repository, commitHash plumbing.Hash) ([]*object.Commit, error)
- func GetLatestVersion(repo *git.Repository) (*semverutils.SemVer, error)
- type TagInfo
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoCommitsFound indicates that no commits were found since the given hash. ErrNoCommitsFound = errors.New("no commits found since given hash") // ErrNoValidVersionTags indicates that no valid version tags were found. ErrNoValidVersionTags = errors.New("no valid version tags found") // ErrNoTags indicates that no tags were found in the repository. ErrNoTags = errors.New("no tags found") )
Functions ¶
func GetCommitFromTag ¶
GetCommitFromTag retrieves the commit that a tag points to, handling both lightweight and annotated tags.
func GetCommitMessagesSinceCommitHash ¶
func GetCommitMessagesSinceCommitHash( repo *git.Repository, commitHash plumbing.Hash, ) ([]string, error)
GetCommitMessagesSinceCommitHash returns the commit messages for all commits made after the specified commit hash. Returns ErrNoCommitsFound if no commits are found.
func GetCommitsSinceCommitHash ¶
func GetCommitsSinceCommitHash( repo *git.Repository, commitHash plumbing.Hash, ) ([]*object.Commit, error)
GetCommitsSinceCommitHash returns all commits made after the specified commit hash. Returns ErrNoCommitsFound if no commits are found.
func GetLatestVersion ¶
func GetLatestVersion(repo *git.Repository) (*semverutils.SemVer, error)
GetLatestVersion returns the latest semantic version as a SemVer struct. Returns ErrNoTags if no tags are found. Returns ErrNoValidVersionTags if no valid version tags are found.
Types ¶
type TagInfo ¶
TagInfo holds information about a git tag.
func GetLatestVersionTag ¶
func GetLatestVersionTag(repo *git.Repository) (*TagInfo, error)
GetLatestVersionTag finds the most recent semantic version tag in the repository. Returns ErrNoValidVersionTags if no valid version tags are found. Returns ErrNoTags if no tags are found in the repository.
func GetTagsWithAssociatedCommits ¶
func GetTagsWithAssociatedCommits(repo *git.Repository) ([]TagInfo, error)
GetTagsWithAssociatedCommits returns all tags in the repository with their associated commits. Returns ErrNoTags if no tags are found.