Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoTags = errors.New("repository has no tags (git describe failed)")
View Source
var ErrNotInsideWorktree = errors.New("dir is outside of git worktree")
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` Dirty bool // repo returns non-empty `git status --porcelain` }
Stats contains a set of git statistics
type VersionInfo ¶ added in v0.0.3
type VersionInfo struct { SemanticTag version.Semantic // as parsed from tag Semantic version.Semantic // with additional commits, if != 0 AdditionalCommits int Quad version.Quad Pre string // semantic pre-release suffix Build string // semantic build suffix }
VersionInfo contains version information in various formats
func LastSemanticTag ¶ added in v0.3.0
func LastSemanticTag(dir string) (string, *VersionInfo, error)
func ParseVersion ¶ added in v0.0.3
func ParseVersion(d Description) (*VersionInfo, error)
ParseVersion extracts useful version info from git.Stat description
Click to show internal directories.
Click to hide internal directories.