Documentation
¶
Index ¶
- Constants
- func CheckBranch(repoPath string, config cfg.SinceConfig) error
- func CommitChangelog(repoPath string, changelogFile string, version string) (hash string, err error)
- func FetchCommitMessages(config cfg.SinceConfig, repoPath string, beforeTag string, afterTag string, ...) ([]string, error)
- func FetchCommitsByTag(config cfg.SinceConfig, repoPath string, beforeTag string, afterTag string, ...) (*[]TagCommits, error)
- func FlattenCommits(tags *[]TagCommits) []string
- func GetEarliestTag(repoPath string, orderBy TagOrderBy) (string, error)
- func GetHeadSha(repoPath string) (string, error)
- func GetLatestTag(repoPath string, orderBy TagOrderBy) (string, error)
- func TagRelease(repoPath string, hash string, version string) error
- type ReleaseMetadata
- type TagCommits
- type TagMeta
- type TagOrderBy
Constants ¶
const UnreleasedVersionName = "Unreleased"
Variables ¶
This section is empty.
Functions ¶
func CheckBranch ¶
func CheckBranch(repoPath string, config cfg.SinceConfig) error
CheckBranch checks if the current branch is the required branch.
func CommitChangelog ¶
func CommitChangelog(repoPath string, changelogFile string, version string) (hash string, err error)
CommitChangelog commits the changelog file.
func FetchCommitMessages ¶
func FetchCommitMessages(
config cfg.SinceConfig,
repoPath string,
beforeTag string,
afterTag string,
unique bool,
) ([]string, error)
FetchCommitMessages returns a slice of commit messages between the given tags. If beforeTag is empty, then HEAD is used. If afterTag is empty, the oldest commit is used.
func FetchCommitsByTag ¶ added in v0.15.0
func FetchCommitsByTag(
config cfg.SinceConfig,
repoPath string,
beforeTag string,
afterTag string,
unique bool,
) (*[]TagCommits, error)
FetchCommitsByTag returns a map of commit messages between the given tags. The key is the tag metadata, and the value is a slice of commit messages. If beforeTag is empty, then HEAD is used. If afterTag is empty, the oldest commit is used.
func FlattenCommits ¶ added in v0.15.0
func FlattenCommits(tags *[]TagCommits) []string
func GetEarliestTag ¶ added in v0.15.0
func GetEarliestTag(repoPath string, orderBy TagOrderBy) (string, error)
GetEarliestTag returns the earliest tag in the repository, determined by the given order.
func GetHeadSha ¶
func GetHeadSha(repoPath string) (string, error)
GetHeadSha returns the SHA of the HEAD commit.
func GetLatestTag ¶
func GetLatestTag(repoPath string, orderBy TagOrderBy) (string, error)
GetLatestTag returns the latest tag in the repository, determined by the given order.
func TagRelease ¶
func TagRelease(repoPath string, hash string, version string) error
TagRelease tags the repository with the given version.
Types ¶
type ReleaseMetadata ¶
type ReleaseMetadata struct {
NewVersion string
OldVersion string
RepoPath string
Sha string
VPrefix bool
}
type TagCommits ¶ added in v0.15.0
type TagCommits struct {
TagMeta
Commits []string
}
type TagOrderBy ¶
type TagOrderBy string
const (
TagOrderAlphabetical TagOrderBy = "alphabetical"
TagOrderCommitDate TagOrderBy = "commit-date"
TagOrderSemver TagOrderBy = "semver"
)