vcs

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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 TagMeta added in v0.15.0

type TagMeta struct {
	Name string
	Date time.Time
}

type TagOrderBy

type TagOrderBy string
const (
	TagOrderAlphabetical TagOrderBy = "alphabetical"
	TagOrderCommitDate   TagOrderBy = "commit-date"
	TagOrderSemver       TagOrderBy = "semver"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL