vcsrepository

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectGitRepositoryInformation

func CollectGitRepositoryInformation(dir string, data map[string]string) (map[string]string, error)

CollectGitRepositoryInformation retrieves normalized variables of the git repository

func FindGitReference

func FindGitReference(refType string, refName string) string

FindGitReference returns the unique reference

func FindRepositoryDirectory

func FindRepositoryDirectory(currentDirectory string) string

func GetReferenceByName

func GetReferenceByName(projectDirectory string, refType string, refName string) (string, error)

GetReferenceByName returns a unique identifier for a refType (tag, branch) / reFName (branch name / tag name)

func GetVCSRepositoryInformation

func GetVCSRepositoryInformation(dir string) (map[string]string, error)

GetVCSRepositoryInformation detects the repository type and gathers normalized information from the repository

func GetVCSRepositoryType

func GetVCSRepositoryType(dir string) string

GetVCSRepositoryType returns a short name of the repository type inside the directory (git, svn, unknown)

func IsGitRepository

func IsGitRepository(directory string) bool

IsGitRepository checks if the target directory contains a git repository

Types

type Commit

type Commit struct {
	ShortHash   string
	Hash        string
	Message     string
	Description string
	Author      CommitAuthor
	Committer   CommitAuthor
	Tags        []CommitTag
	AuthoredAt  time.Time
	CommittedAt time.Time
	Context     map[string]string
}

func FindCommitsBetweenRefs

func FindCommitsBetweenRefs(dir string, startRef string, endRef string) ([]Commit, error)

FindCommitsBetweenRefs finds all git commits between two references

func FindGitCommitsBetweenRefs

func FindGitCommitsBetweenRefs(projectDir string, from string, to string) ([]Commit, error)

FindGitCommitsBetweenRefs finds all git commits between two references, get references via FindGitReference

type CommitAuthor

type CommitAuthor struct {
	Name  string
	Email string
}

type CommitTag

type CommitTag struct {
	Name   string
	VCSRef string
}

type Release

type Release struct {
	Name      string
	Reference string
}

func FindLatestGitRelease

func FindLatestGitRelease(projectDir string, from string, stable bool, skipFrom bool) (Release, error)

func FindLatestRelease

func FindLatestRelease(dir string, startAtReference string, stable bool, skipFrom bool) (Release, error)

FindLatestRelease will retrieve the latest release version in the current branch

Jump to

Keyboard shortcuts

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