git

package
v0.0.0-...-64567a0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Unspecified = "unspecified"

Variables

This section is empty.

Functions

func IsSnapshotVersion

func IsSnapshotVersion(version string) bool

func ProjectBranch

func ProjectBranch(gitDir string) (string, error)

func ProjectRevision

func ProjectRevision(gitDir string) (string, error)

func ProjectVersion

func ProjectVersion(gitDir string) (string, error)

ProjectVersion returns the version string for the git repository that the provided directory is in. The output is the output of "git describe --tags" followed by ".dirty" if the repository currently has any uncommitted changes. Returns an error if the provided path is not in a git root or if the git repository has no commits or no tags.

Types

type ProjectInfo

type ProjectInfo struct {
	Version  string
	Branch   string
	Revision string
}

func NewProjectInfo

func NewProjectInfo(gitDir string) (ProjectInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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