git

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoTag happens if the underlying git repository doesn't contain any tags
	// but no snapshot-release was requested.
	ErrNoTag = errors.New("git doesn't contain any tags. Tag info will not be available")

	// ErrNotRepository happens if you try to run ko against a folder
	// which is not a git repository.
	ErrNotRepository = errors.New("current folder is not a git repository. Git info will not be available")

	// ErrNoGit happens when git is not present in PATH.
	ErrNoGit = errors.New("git not present in PATH. Git info will not be available")
)

Functions

This section is empty.

Types

type ErrDirty

type ErrDirty struct {
	// contains filtered or unexported fields
}

ErrDirty happens when the repo has uncommitted/unstashed changes.

func (ErrDirty) Error

func (e ErrDirty) Error() string

type Info

type Info struct {
	Branch      string
	Tag         string
	ShortCommit string
	FullCommit  string
	CommitDate  time.Time
	Dirty       bool
}

Info includes tags and diffs used in some point.

func GetInfo

func GetInfo(ctx context.Context, dir string) (Info, error)

GetInfo returns git information for the given directory

func (Info) TemplateValue

func (i Info) TemplateValue() map[string]interface{}

TemplateValue converts this Info into a map for use in golang templates.

Jump to

Keyboard shortcuts

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