git

package
v0.0.0-...-abeb386 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

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