git

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	Filesystem billy.Filesystem
	// contains filtered or unexported fields
}

Git is a helper for git.

func NewGit

func NewGit() (g *Git, err error)

NewGit instantiates and returns a Git struct.

func NewGitFromClone

func NewGitFromClone(url string, ref plumbing.ReferenceName) (g *Git, err error)

NewGitFromClone instantiates and returns a Git struct.

func (*Git) Branch

func (g *Git) Branch() (branch string, isBranch bool, err error)

Branch returns the current git branch name.

func (*Git) Describe

func (g *Git) Describe() (result string, err error)

Describe returns git describe-based version.

If no tags are present: `8513435-dirty` or `8513435`

Exactly on the tag `v0.1`: `v0.1-dirty` or `v0.1`

Some commits ahead of tag `v0.1`: `v0.1-1-g23cbce5` (1 commit ahead, `g` followed by abbreviated git SHA).

func (*Git) Message

func (g *Git) Message() (message string, err error)

Message returns the commit message. In the case that a commit has multiple parents, the message of the last parent is returned.

func (*Git) Ref

func (g *Git) Ref() (ref string, err error)

Ref returns the current git ref name.

func (*Git) SHA

func (g *Git) SHA() (sha string, err error)

SHA returns the sha of the current commit.

func (*Git) Status

func (g *Git) Status() (status string, isClean bool, err error)

Status returns the status of the working tree.

func (*Git) Tag

func (g *Git) Tag() (tag string, isTag bool, err error)

Tag returns the tag name if HEAD is a tag.

Jump to

Keyboard shortcuts

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