git

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Description added in v0.0.2

type Description struct {
	Tag               string
	AdditionalCommits int // number of additional commits after the last tag
	ShortHash         string
}

Description contains the results of parsing the git describe output

func ParseDescription added in v0.0.2

func ParseDescription(s string) (*Description, error)

ParseDescription parses the result of `git describe --long`

type Stats

type Stats struct {
	Branch      string      // result of `git branch --show-current`
	Description Description // result of `git describe --long` command
	Hash        string      // result of `git rev-parse HEAD` command
	ShortHash   string      // result of `git rev-parse --short HEAD` command
	AuthorDate  string      // result of `git log -n1 --date=format:"%Y-%m-%dT%H:%M:%S" --format=%ad`
}

Stats contains a set of git statistics

func Stat

func Stat(dir string) (*Stats, error)

Stat obtains git stats for a specified local directory

type VersionInfo added in v0.0.3

type VersionInfo struct {
	SemanticTag       semver.Version // as parsed from tag
	Semantic          semver.Version // with additional commits, if != 0
	AdditionalCommits int
	Triplet           string // Major.Minor.Patch
	Quad              string // dot-separated quad (Major.Minor.Patch.GitAdditionalCommits)
	NNNN              string // comma-separated quad, useful for windows RC building
	Pre               string // semantic pre-release suffix
	Build             string // semantic build suffix
}

VersionInfo contains version information in various formats

func ParseVersion added in v0.0.3

func ParseVersion(d Description) (*VersionInfo, error)

ParseVersion extracts useful version info from git.Stat description

Jump to

Keyboard shortcuts

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