Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescVersion ¶
type DescVersion struct {
LastTag string
AdditionalCommits string // number of additional commits after the last tag
Numeric string
Quad ver.Quad // semantic version extracted from tag: "0.1.2.3"
Combined string
}
DescVersion contains the results of parsing the git describe output with RetrieveSemanticVersionV4 (see below)
type Stats ¶
type Stats struct {
Branch string // result of `git branch --show-current`
Describe string // 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 (*Stats) RetrieveSemanticVersionV4 ¶
func (s *Stats) RetrieveSemanticVersionV4() (*DescVersion, error)
RetrieveSemanticVersionV4 parses the result of git describe and extracts the application version number assuming the repo is tagged with v1.2.3.4 tags. If the repo had evolved since the last tag, the git describe adds a suffix in a -<nsteps>-<hash> form that is reported in the Suffix field of the returned struct
Click to show internal directories.
Click to hide internal directories.